Deep Linking iOS Push Notifications

前端 未结 2 755
-上瘾入骨i
-上瘾入骨i 2021-01-13 06:39

I\'d like to be able to send the viewer to a specific view in the app when they get the push notification, based upon what I send them.

    \"aps\": {
               


        
相关标签:
2条回答
  • 2021-01-13 07:15

    Try to move your dictionary entry for view outside of the "aps" dictionary.

    {
        "aps": 
        {
            "alert": "look at this stuff"
        }
        "view": "wc1"
     }
    
    0 讨论(0)
  • 2021-01-13 07:19

    When application is loaded you can detect that in your appdelegate class in that method:

     didFinishLaunchingWithOptions 
    
    NSDictionary *pushNotification = [options objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    
    if(pushNotification )
    {
        //Handle remote notification
    }
    

    If application is still running in background and notification came, you can detect that also in your AppDelegate class:

    -(void)application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *)userInfo
    
    0 讨论(0)
提交回复
热议问题