java中的接口是类吗
260
2022-10-31
个推发送消息各字段在系统状态栏显示的信息,点击消息图标激活应用传递的信息,应用在线收到的透传消息信息
个推测试透传消息,个推网站测试只支持透传消息 创建推送—透传消息 目标平台:iOS开发环境 透传内容 描述:测试页面跳转4 消息内容:{“tk1”:”tv1”,”tk2”:”tv2”} 定速推送:关闭 展示条件:无 APN参数设置 模式选择:iOS设置 content-available:0 (app在线推送透传消息,不在线就推送apns消息) title: test444 body: body444 badge:1 sound:默认 payload:与消息内容一致 iOS多媒体推送:否 category:category1 title-loc-key:title-loc-key1 title-loc-args:title-loc-args loc-args:loc-args loc-key:loc-key category:
title-loc-key:
title-loc-args:
loc-args:
loc-key:
launch-image:select subtitle-loc-key1:subtitle-loc-key1 subtitle-loc-args:subtitle-loc-args1 subtitle:subtitle apns-collapse-id:apns-collapse-id1 action-loc-key:action-loc-key1 目标选择:全部用户 推送设置 推送方式:即使 消息有效期:是 有效时长:2小时,该时间段内CID在线过的用户均可收到通知。(0-72小时内的正整数)
AppDelegate.m:AppDelegate.m:-[AppDelegate application:didFinishLaunchingWithOptions:]:37 Verbose:didFinishLaunchingWithOptions message:{ "_ge_" = 1; "_gmid_" = "GT_0824_32bba9e07271dbcfd39a3dc85d014fa2:b0777f08-24aa-16567d8f1d0-1466927070:4790715966c94d93e84182fbfce36182"; "_gurl_" = "sdk.open.extension.getui.com:8123"; aps = { alert = { "action-loc-key" = "action-loc-key1"; body = body444; "launch-image" = select; "loc-args" = ( "loc-args" ); "loc-key" = "loc-key"; subtitle = subtitle; "subtitle-loc-args" = ( "subtitle-loc-args1" ); "subtitle-loc-key" = "subtitle-loc-key1"; title = test444; "title-loc-args" = ( "title-loc-args" ); "title-loc-key" = "title-loc-key1"; }; badge = 1; category = category1; "mutable-content" = 1; sound = default; }; payload = "{\"tk1\":\"tv1\",\"tk2\":\"tv2\"}";}
AppDelegate.m:AppDelegate.m:-[AppDelegate application:didFinishLaunchingWithOptions:]:37 Verbose:didFinishLaunchingWithOptions message:{ "_ge_" = 1; "_gmid_" = "GT_0824_02819c75c17adf33e6faa43842072025:b0777f08-24aa-16567d8f1d0-1455623540:4790715966c94d93e84182fbfce36182"; "_gurl_" = "sdk.open.extension.getui.com:8123"; aps = { alert = { "action-loc-key" = "action-loc-key1"; body = body2; "launch-image" = select; "loc-args" = ( "loc-args" ); "loc-key" = "loc-key"; subtitle = subtitle; "subtitle-loc-args" = ( "subtitle-loc-args1" ); "subtitle-loc-key" = "subtitle-loc-key1"; title = test2; "title-loc-args" = ( "title-loc-args" ); "title-loc-key" = "title-loc-key1"; }; badge = 1; category = category1; "mutable-content" = 1; sound = default; }; payload = jump;}
三:应用在线,收到透传消息的消息,系统栏不显示推送的消息:
>>>[GexinSdk ReceivePayload]:taskId=GT_0824_6df34b352b517e4766883c2b3cf138bd,messageId:28ae7ef0-bc-16567df2b2d-1482748620,payloadMsg:{"tk1":"tv1","tk2":"tv2"}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // [2-EXT]: 获取启动时收到的APN NSDictionary* message = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; FLDDLogVerbose(@"didFinishLaunchingWithOptions message:%@", message); if (message) { NSString *payloadMsg = [message objectForKey:@"payload"]; NSString *record = [NSString stringWithFormat:@"[APN]%@, %@", [NSDate date], payloadMsg]; //如何跳转页面自己添加代码// // self.window.rootViewController = self.viewController; } return YES;}
四:应用在线,系统栏不显示推送的消息。若想显示也可以,就是把需要显示的标题和内容放在body的键值对里,收到透传消息,弹出本地消息。弹出本地消息的代码如下,注意,一般要把重复间隔设置为0,不然你的应用每天这个时间就会显示通知,当然你有像这样的需求是个例外:
UILocalNotification *notification = [[UILocalNotification alloc] init]; if (notification != nil) { // 设置推送时间 notification.fireDate = [NSDate date]; // 设置时区 notification.timeZone = [NSTimeZone defaultTimeZone]; // 设置重复间隔 notification.repeatInterval = 0; // 推送声音// notification.soundName = UILocalNotificationDefaultSoundName;// NSArray *array=[NSArray arrayWithObjects:@"order_music_texi.mp3",@"order_music_new.mp3",@"order_music_comfortable.mp3",@"order_music_luxury.mp3",@"order_music_commicail.mp3", nil]; NSArray *arrayBody=[NSArray arrayWithObjects:@"您有一个出租车订单",@"您有一个新能源订单",@"您有一个舒适型订单",@"您有一个豪华型订单",@"您有一个商务型订单", nil];// notification.soundName = array[[[newDict valueForKey:@"serviceType"] intValue] - 1];// // 推送内容 notification.alertBody = arrayBody[[[newDict valueForKey:@"serviceType"] intValue] - 1]; //显示在icon上的红色圈中的数子 notification.applicationIconBadgeNumber =0; //添加推送到UIApplication UIApplication *app = [UIApplication
个推测试网站,发送iOS透传消息时,可以选择特定用户,需要上传CID列表。个推开放平台上特定用户推送时上传的用户列表是怎样的格式是:上传的是txt文件,一行一个clientid,回车换行。具体见这个例子,你把里面那行clientid换成自己的就可以,注意:要保持纯文本格式,保留换行符。个推cid列表文件
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~