当我收到推送通知时,我该如何拨打电话?

我已经开发了预约申请。当我收到推送通知时,我想打电话给某个人,但是现在它只是在我收到推送通知时打开应用程序。 当我收到该约会的推送通知时,如何编写代码来调用特定约会?     
已邀请:
收到通知后,打开带有给定电话号码的拨号器应用程序。注意:这将首先启动您的应用,然后快速切换到拨号器。
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://5555555555"]];
}
    
对于推送通知,您必须在appDelegate中编码,
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
       [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",[userInfo valueForKey:@"phno"]]]];
}
对于本地通知,
    -(void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
    {
       [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",[notification.userInfo valueForKey:@"phno"]]]];
    }
    

要回复问题请先登录注册