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后就能在生产环境测试推送了

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

  • 相关阅读:
    模糊查询的like '%$name$%'的sql注入避免
    在VS2010中使用Git(转)
    android WebView解析 调用html5
    git
    推荐!手把手教你使用Git
    羽毛拍十大品牌
    乒乓球拍板和皮子世界排名
    足球小记
    centos 网络启动 在/etc/sysconfig/network-scripts/ifcfg-eth1onboot=yes即可
    MyEclipseGen--------生成
  • 原文地址:https://www.cnblogs.com/tufei7/p/10767453.html
Copyright © 2011-2022 走看看