salesforce 推送

  • Post author:
  • Post category:其他


关于salesforce推送:

SDK已经更新的到8.0了,所以推送注册时候的方法跟随SDK升级

上代码:

在didFinishLaunchingWithOptions中实现:

//Register remote notifaction

UIUserNotificationType types =

UIUserNotificationTypeBadge|

UIUserNotificationTypeSound|

UIUserNotificationTypeAlert;

UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil];

[application registerUserNotificationSettings:mySettings];

[[UIApplication sharedApplication] registerForRemoteNotifications];

在didRegisterForRemoteNotificationsWithDeviceToken实现

[[SFPushNotificationManager sharedInstance] didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]

此函数可以输出device

下一步获得推送过来的消息

在didReceiveRemoteNotification中获得,然后进行处理

最后选择好证书,就可以收到通知!



版权声明:本文为u010137365原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。