PhoneGap / iOS LocalNotification App Crashes on tapping “View”

后端 未结 4 431
孤城傲影
孤城傲影 2021-01-02 20:46

I\'m having trouble here: I have the app set to not run in the background, and I\'m setting a dailyInterval localnotification using a localNotification plugin I found on git

4条回答
  •  忘掉有多难
    2021-01-02 21:39

    A little bit better solution is something like this:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        NSArray *keyArray = [launchOptions allKeys];
        if ([keyArray count] > 0) {
            id option = [launchOptions objectForKey:[keyArray objectAtIndex:0]];
            if ([option isKindOfClass:[NSURL class]]) {
                NSURL *url = (NSURL *)option;
                self.invokeString = [url absoluteString];
                NSLog(@"ContactInbox launchOptions = %@",url);
            }
        }
    
        return [super application:application didFinishLaunchingWithOptions:launchOptions];
    }
    

    If somebody knows what key PhoneGap expects to have for URL it's better to replace [keyArray objectAtIndex:0] part with actual key.

提交回复
热议问题