iOS友盟推送测试模式添加手机设备报红解决如下

设备描述红色一般是没有往友盟发日志,或者appkey漏掉了。
先检查是否正确的填写了推送的appkey,统计的方法为MobClick startWithAppkey;推送的方法为UMessage startWithAppkey 是两个不同的方法。

如果还是不行IOS首先用以下代码判断有木有错误:

didFailToRegisterForRemoteNotificationsWithError:(NSError *)err
{
    
    NSString *error_str = [NSString stringWithFormat: @"%@", err];
    NSLog(@"Failed to get token, error:%@", error_str);
    
}
同时:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    [UMessage registerDeviceToken:deviceToken];
    
    NSLog(@"didRegisterForRemoteNotificationsWithDeviceToken success");
    
    NSLog(@"%@",[[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""]
                  stringByReplacingOccurrencesOfString: @">" withString: @""]
                 stringByReplacingOccurrencesOfString: @" " withString: @""]);
    
}

  其中[UMessage registerDeviceToken:deviceToken];不能注释掉。
如果还是不行的话,可以再次对app进行卸载重装。

然后再到友盟应用上添加测试设备就好了

原文地址:https://www.cnblogs.com/sunfuyou/p/6952597.html