测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
协议 | MIT |
发布最后发布 | 2022年2月 |
依赖关系 | |
AFNetworking | >= 0 |
NHNetworkTime | >= 0 |
NSHash | >= 0 |
要使用ox-push2框架,您可以编辑您的Podfile,只需添加以下内容
pod 'ox-push2-ios-pod', :git => 'https://github.com/GluuFederation/ox-push2-ios-pod.git'
或者将“ox-push2-ios-pod”文件夹复制并粘贴到您的项目文件夹中
首先,您需要创建OXPushManager类的对象
OXPushManager* oxPushManager = [[OXPushManager alloc] init];
还建议设置设备的推送通知令牌。在设备注册时,Gluu的服务器应用会发送推送通知令牌以及UDID,之后当您尝试进行认证请求时,您将收到包含认证请求数据的推送。设置令牌,只需使用“setDevicePushToken”方法即可。
[oxPushManager setDevicePushToken:@"deviceToken"];
要发送注册/认证请求,您应该调用“onOxPushApproveRequest”方法
[oxPushManager onOxPushApproveRequest:jsonDictionary isDecline:NO callback:^(NSDictionary *result,NSError *error){
if (error) {
[self showAlertViewWithTitle:@"Info" andMessage:@"Authentication failed"];
} else {
//Success
[self showAlertViewWithTitle:@"Info" andMessage:@"Authentication success"];
}
}];
参数