解析推送通知忽略默认的推送回调类

时间:2014-08-12 12:59:37

标签: android push-notification parse-platform

通知正常。问题是,当TeamActivity设置为默认推送回调活动时,点击通知时会启动MainActivity

/// Application class
PushService.setDefaultPushCallback(this, MainActivity.class);

在清单中:

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TeamActivity"
        android:label="@string/title_activity_team"
        android:parentActivityName=".MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.panchicore.xxx.MainActivity" />
    </activity>
    <... other activities />
    <... service and receivers from pusher />

按“确定”:

{
    "title": "Hello world",
    "alert": "Hola mundo",
    "push_hash": "2d799b605347b6aaeabb203ab1387601"
}

TeamActivity上的回调不在MainActivity上。

1 个答案:

答案 0 :(得分:0)

更改您的清单,如下所示。

<application
        android:name="ParseApplication"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".ProjectActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
        </activity>

        <activity
            android:name=".TeamActivity"
        </activity>

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

        <receiver android:name="com.parse.ParseBroadcastReceiver" >
            <intent-filter>


                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.RECEIVE_BOOT_COMPLETED" />  
                <action android:name="android.intent.action.USER_PRESENT" />


               <!--  <action android:name="MyAction" > -->

            </intent-filter>
        </receiver>

希望它能奏效。