Changes required in Xcode

It is required by Gamooga that you enable Background Mode in the Capabilities section of the main app target. After enabling background modes, select Remote Notification as shown in the snapshot.

Appdelegate changes

Define Macros

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)

Registering for push notifications

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   TargetActClient *tc = [TargetActClient sharedInstance];
   [tc doPushRegistration];
   return YES;
}

Sending the push token to Gamooga servers

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    TargetActClient *tc = [TargetActClient sharedInstance];
   [tc updatePushRegistrationId:deviceToken];
}

Handling Push Notification

Notifications are delivered while the app is in foreground, background or not running state. We can handle them in the following delegate methods.
If the remote notification is tapped, the system calls the method of the app delegate.
You can handle the notification and its payload as described:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler {
if( SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO( @"10.0" ) )
{
    NSLog( @"iOS version >= 10. Let NotificationCenter handle this one." );
   return;
}
 handler(UIBackgroundFetchResultNoData);
  NSLog(@"Received: %@",userInfo);
}