i am using parse push for my ios app (using xcode). I want to track the app and push-openings. The background state and inactive state are working, but foreground fails. While i'm receiving push in Foreground push open statistic stays on 0. This is what i have so far..
I hope somebody can help me :-)
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if(application.applicationState == UIApplicationStateInactive) {
NSLog(@"Inactive");
[PFPush handlePush:userInfo];
completionHandler(UIBackgroundFetchResultNewData);
[PFAnalytics trackAppOpenedWithRemoteNotificationPayload:userInfo];
} else if (application.applicationState == UIApplicationStateBackground) {
NSLog(@"Background");
[PFPush handlePush:userInfo];
completionHandler(UIBackgroundFetchResultNewData);
[PFAnalytics trackAppOpenedWithRemoteNotificationPayload:userInfo];
} else {
NSLog(@"Active");
[PFPush handlePush:userInfo];
completionHandler(UIBackgroundFetchResultNewData);
[PFAnalytics trackAppOpenedWithRemoteNotificationPayload:userInfo];
}
}