zoukankan      html  css  js  c++  java
  • 推送测试,生产环境无法打印log获取deviceToken,可以通过弹窗获取deviceToken


    z- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { NSString *token = [[[[deviceToken description] stringByReplacingOccurrencesOfString:@"<" withString:@""] stringByReplacingOccurrencesOfString:@">" withString:@""] stringByReplacingOccurrencesOfString:@" " withString:@""]; NSLog(@"deviceToken: %@ ", token); UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"当前的token" message:token delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定", nil]; [alertView show]; NSString *tokens = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]]; NSLog(@"deviceToken=%@", tokens); // [self testGetClientId]; }

    想要在生产环境测试推送,但是生产环境看不到log信息,怎么办呢?写个弹窗,显示deviceToken,打包成ADhoc,上传蒲公英,下载安装后就能看到生产环境的deviceToken了。注意:生产环境的deviceToken跟开发环境不同。获取生产环境的deviceToken后就能在生产环境测试推送了

    这玩意是设置了推送能力之后自动生成的

  • 相关阅读:
    《你早该这么玩Excel》书摘
    如何提高你的移动开发中AS3/AIR性能
    Starling之资源管理类
    新版Chrome手动安装flashplayer plugin无效的问题
    常用排序算法比较
    pureMVC框架
    AS3.0的事件机制
    如何成为强大的程序员?
    Starling实现的3D云彩效果
    EnterFrame和Timer区别
  • 原文地址:https://www.cnblogs.com/tufei7/p/10767453.html
Copyright © 2011-2022 走看看