• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

iOS UIApplicationDelegate implementation issues

chirpy

Member
I'm branching from the official 2.3.1 release thread to not dilute other issues and discussions.
https://forum.yoyogames.com/index.php?threads/gms2-version-2-3-1-beta-release.79757/post-477098

@clee2005
First thing, yes the iOS_IAPs extension's code should be modified as well; otherwise it can be checking wrong class.

Other than that, in other extensions (that implement app delegate protocol), what are affected depend on which methods are implemented / shadowed when it should be properly inherited and overriden.

If the extension implemented any UIApplicationDelegate methods, but does not invoke the superclass' implementation, then the aforementioned snippet should probably be added within its UIApplicationDelegate method bodies:
Code:
// if the base class also implemented this method
if ([${YYExtAppDelegateBaseClass} class] instancesRespondToSelector @selector(theMethodSignature))
{
    // invoke it (just like calling event_inherited() in inherited gml events)
    [super application:application willFinishLaunchingWithOptions:launchOptions]; //match the method signature
}
Here's Apple's doc on UIApplicationDelegate protocol (objC's thing similar to interface if I understand correctly).
Most commonly GMS extensions care about are those listed under:
- "Initializing the App"
- "Responding to App Life-Cycle Events"
You can check your extensions' app delegate files to see which methods are implemented, and ensure it is not shadowing the whole inheritance chain unintentionally.

All said, it's surely the extension author's responsibility to maintain it properly. o_O
 

clee2005

Member
Thanks so much for the details @chirpy ! This makes a lot of sense. I don't think there is any other extensions using this particular event/method :

GML:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
Which makes sense that everything continues to work even though the App Delegate Class Name field is empty.

It's really great to get some help with native extensions, as I find there is VERY little documentation on GMS Extensions anywhere. I'm not sure why YoYo doesn't put out more advanced documentation to encourage the development of extensions. I find I have to guess at how to do things and look at existing extensions - which is made even more difficult when the ones coming from YoYo are wrong as well. LOL
 

chirpy

Member
Thanks for the details. It looks like that you only need to fix the IAP part so the inheritance chain would work as intended.

If you removed the app delegate class name, then that extension would probably not be getting remote notifications, which is perfectly fine if you don't use them at all.

If the remote notifications (push notifications/firebase cloud messaging) still work after app delegate class removal ... then ... it's magic I don't understand. :D (Could be saying the inheritance chain is never needed??)
 
Top