以前用过极光,第一次用个推,极光的推送通知可以自己接收到,自己控制通知样式以及跳转,而个推的通知好像控制不了,完全由个推控制的,想要跳转到一个特定的页面,没法跳转了,有没有同时用过极光和个推的伙伴,分享一下经验,谢谢。
给的demo也只有透传处理的地方。
switch (bundle.getInt(PushConsts.CMD_ACTION))
{
case PushConsts.GET_MSG_DATA:
// 获取透传数据
String appid = bundle.getString("appid");
byte[] payload = bundle.getByteArray("payload");
String taskid = bundle.getString("taskid");
String messageid = bundle.getString("messageid");
// smartPush第三方回执调用接口,actionid范围为90000-90999,可根据业务场景执行
boolean result = PushManager.getInstance().sendFeedbackMessage(context, taskid, messageid, 90001);
LogUtils.zouyb("第三方回执接口调用" + (result ? "成功" : "失败"));
if (payload != null)
{
String data = new String(payload);
LogUtils.zouyb("Got Payload:" + data);
}
if (!isTopActivity(context, "com.hydbest.hydp2p.activity.MainActivity"))
{
if (Provider.getInstance().isGesture())
{
intent = new Intent();
intent.setClass(context, GesturePwdActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
} else
{
intent = new Intent();
intent.setClass(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
}
break;
case PushConsts.GET_CLIENTID:
// 获取ClientID(CID)
// 第三方应用需要将CID上传到第三方服务器,并且将当前用户帐号和CID进行关联,以便日后通过用户帐号查找CID进行消息推送
// String cid = bundle.getString("clientid");
break;
case PushConsts.THIRDPART_FEEDBACK:
/*
String appid = bundle.getString("appid"); String taskid =
bundle.getString("taskid"); String actionid =
bundle.getString("actionid"); String result =
bundle.getString("result"); long timestamp =
bundle.getLong("timestamp");
Log.d("GetuiSdkDemo", "appid = " + appid); Log.d("GetuiSdkDemo",
"taskid = " + taskid); Log.d("GetuiSdkDemo", "actionid = " +
actionid); Log.d("GetuiSdkDemo", "result = " + result);
Log.d("GetuiSdkDemo", "timestamp = " + timestamp);
*/
break;
default:
break;
}
You can only use passthrough, notifications cannot be used.
When pushing notifications, you can enable transparent transmission of messages in the advanced settings. If you only use transparent transmission, there will be no notification.