Hi there,
I m willing to write a handler for local notifications that a player taps to launch the game so it brings him to a specific context in the game. I m registering and scheduling correctly the local notifications but as far as I could do to handle local notifications (getting data from the tapped notification, maybe a string) I didn’t succeed. (I know almost nothing about Objective-c coding)
With all the research I’ve done on the internet, I came up with this (non working method) in a .mm file I added to Assets/Plugins/iOS
@implementation HandleLocalNotificationAppDelegate
- (BOOL)application : ( UIApplication *)app didFinishLaunchingWithOptions : ( NSDictionary *)launchOptions {
UILocalNotification *localNotif =
[launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotif) {
// Missing here a way to get data from the notification to send to unity
NSLog(@"FROM IOS :: Received local notif");
UnitySendMessage("Receiver", "GetNotif", "data");
}
returnYES;
}
@end