相关疑难解决方法(0)

GCM和Parse通知冲突

我需要我的Android应用程序使用两个推送服务,GCM和解析.我的问题是我找不到正确注册Parse,获取解析通知和GCM通知的方法.我可以单独完成所有这些事情,但永远不能在一起.我当前的实现看起来像这样:

<!-- GCM BradcastReceiver & Service -->
    <service android:name=".GcmIntentService"
        android:enabled="true"/>
    <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <receiver
        android:name=".GcmBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter
            android:priority="100"> <!-- higher priority to GCM messages -->

            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.twentyLines.GCM_NOTIFICATION_ACTION" />
            <category android:name="com.twentyLines.app" />
        </intent-filter>
    </receiver>
Run Code Online (Sandbox Code Playgroud)

这是用于GCM的broadcastReceiver,下面是另一个用于解析的接收器:

<service android:name="com.parse.PushService" />

    <receiver android:name="com.parse.GcmBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter android:priority="0">

            <!--<action android:name="com.google.android.c2dm.intent.RECEIVE" />-->
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
            <category android:name="com.twentyLines.app" />
        </intent-filter>
    </receiver>
    <!-- Can remove this if application is already registered for GCM -->
    <receiver android:name="com.parse.ParseBroadcastReceiver" android:exported="false" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action …
Run Code Online (Sandbox Code Playgroud)

android push-notification parse-platform

5
推荐指数
1
解决办法
3068
查看次数