0.接入推送
0.创建推送证书、创建极光推送应用
这部分不做赘述
1.接入iOS SDK
在 Siging & Capabilities 中添加 Access WiFi Information 和 PushNotifications
同时打开 Remote notifications
在Podfile中加入pod 'JCore'
pod 'JPush'
然后执行 pod install 导入SDK
在桥接文件中加入// 引入 JPush 功能所需头文件
#import "JPUSHService.h"
// iOS10 注册 APNs 所需头文件
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
#import
#endif
这部分会有版本选择以及IDFA等问题,详见:
1.接收消息
1.注册极光推送
在AppDelegate中的didFinishLaunchingWithOptions中注册极光推送func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// 推送代码
let entity = JPUSHRegisterEntity()
entity.types = 1 << 0 | 1 << 1 | 1 << 2