【发布时间】:2016-08-22 01:31:36
【问题描述】:
每当单击所有传入的推送通知时,我都在努力开发 Android 应用程序以将应用程序重定向到特定的活动页面。我是 android 开发新手,对我的编程感到抱歉。
以下是推送通知部分的 android manifest.xml。如果对此主题有任何评论,我们将不胜感激:-
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<permission
android:name="com.younginnovators.sjk.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. -->
<uses-permission android:name="com.younginnovators.sjk.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<application
android:allowBackup="true"
android:icon="@mipmap/icon"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Push Notifications Receiver -->
<receiver
android:name=".backgroundservices.PushNotificationBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.younginnovators.sjk" />
</intent-filter>
</receiver>
<!-- /Push Notifications Receiver -->
<!-- Push Notifications Service -->
<service android:name=".backgroundservices.PushnotificationService" />
<!-- /Push Notifications Service -->
【问题讨论】:
-
“GCM”已过时。升级到 Firebase。文档更容易理解......顺便说一句,你没有说实际问题是什么。
-
嗨muratgu,我的问题是我的应用程序在点击推送通知后当前进入主页,想知道我是否可以在点击推送通知时重定向到特定页面
-
感谢您的建议,我从未尝试过firebase,会研究一下
标签: android redirect push-notification google-cloud-messaging push