I've implemented Urban Airship's SDK for iOS8 and above.

Everything is OK, and I'm able to send push messages to my device.

I have noticed that i wasn't required to implement the following method:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{

}

which is typically used to pass the token from apple to a remote server.

How is this possible?

Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

Figured it out.

All you need to do is to create a class that inherits from UIResponder, and the conforms to UIApplicationDelegate protocol.

At run time, you will need to:

[[UIApplication sharedApplication] setDelegate:someNewDelegate];

and to foreword the calls to the old delegate (so keep a pointer to it).

** EDIT **

There is also the option of Swizzling. have a look: http://nshipster.com/method-swizzling/