Open muuyao opened 1 year ago
我没用这个库,用的 rammus 那个
这个问题我也遇到了,在此记录下。点击离线通知如果是直接跳转到首页,不处理什么逻辑,则不需要另外配置一个辅助弹窗 activity ,通知点击后跳转 activity 直接填写 MainActivity 即可。如果点击后有逻辑则需要去做辅助弹窗那套东西。
PopupNotifyClickListener 这玩意没有啊
import com.alibaba.sdk.android.push.popup.PopupNotifyClick; import com.alibaba.sdk.android.push.popup.PopupNotifyClickListener; import com.aliyun.ams.push.AliyunPushEventSender;
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); (new PopupNotifyClick(new PopupNotifyClickListener() { @Override public void onSysNoticeOpened(String title, String summary, Map<String, String> extMap) { WritableMap writableMap = new WritableNativeMap(); writableMap.putString("title", title); writableMap.putString("summary", summary); try { if (extMap != null && !extMap.isEmpty()) { JSONObject extra = new JSONObject(); for (Map.Entry<String, String> entry: extMap.entrySet()) { extra.put(entry.getKey(), entry.getValue()); } writableMap.putString("extra", extra.toString()); } } catch (JSONException e) { e.printStackTrace(); } AliyunPushEventSender.sendEvent("onNotificationOpened", writableMap); } })).onCreate(this, this.getIntent()); }
我也碰到了,你是怎么解决的