Commit 959db4c5 authored by guanghui.shi's avatar guanghui.shi

给小米设置alias,兼容消息中心以后的改版

parent aa154aba
...@@ -128,9 +128,10 @@ ...@@ -128,9 +128,10 @@
if (userInfo.userName) { if (userInfo.userName) {
[MiPushSDK setAccount:userInfo.userName]; [MiPushSDK setAccount:userInfo.userName];
} }
[MiPushSDK setAlias:account];
[MiPushSDK subscribe:@"login"]; [MiPushSDK subscribe:@"login"];
[MiPushSDK unsubscribe:@"logout"]; [MiPushSDK unsubscribe:@"logout"];
/// 极光推送--------------------------- /// 极光推送---------------------------
[JPUSHService setAlias:account completion:^(NSInteger iResCode, NSString *iAlias, NSInteger seq) { [JPUSHService setAlias:account completion:^(NSInteger iResCode, NSString *iAlias, NSInteger seq) {
NSLog(@"设置别名:%@",iAlias); NSLog(@"设置别名:%@",iAlias);
...@@ -147,6 +148,7 @@ ...@@ -147,6 +148,7 @@
if (QGUserInfo.sharedUserInfo.userName.length > 0) { if (QGUserInfo.sharedUserInfo.userName.length > 0) {
[MiPushSDK unsetAccount:QGUserInfo.sharedUserInfo.userName]; [MiPushSDK unsetAccount:QGUserInfo.sharedUserInfo.userName];
} }
[MiPushSDK unsetAlias:account];
[MiPushSDK subscribe:@"logout"]; [MiPushSDK subscribe:@"logout"];
[MiPushSDK unsubscribe:@"login"]; [MiPushSDK unsubscribe:@"login"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment