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

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

  • 相关阅读:
    BlogEngine.Net
    加速Web开发的9款知名HTML5框架
    个人论坛博客的代码
    Android客户端调用Asp.net的WebService
    前端总结数据结构与算法基础
    node知识点及第三方模块
    消息轮播
    el-date-picker 组件时间格式化方式
    Vue+Element前端导入导出Excel
    vue单元测试
  • 原文地址:https://www.cnblogs.com/tufei7/p/10767453.html
Copyright © 2011-2022 走看看