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

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

  • 相关阅读:
    WSDL格式
    eclipse修改文件编码
    eclipse代码格式化设置
    批量修改Java类文件中引入的package包路径
    Oracle 创建用户
    电脑端口介绍
    Python Web 性能和压力测试 multi-mechanize
    C++使用ocilib访问oracle数据库
    IPython使用学习笔记
    .NET Core与.NET Framework、Mono之间的关系
  • 原文地址:https://www.cnblogs.com/tufei7/p/10767453.html
Copyright © 2011-2022 走看看