gpt4 book ai didi

java - 每次推送获取多个通知

转载 作者:太空狗 更新时间:2023-10-29 16:17:07 26 4
gpt4 key购买 nike

当我发出推送通知时,设备上会出现 5 个相同的通知。有什么理由吗?这是我的 application.java 和 list :

公共(public)类 Application 扩展了 android.app.Application {

public Application() {
}

@Override
public void onCreate() {
super.onCreate();
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);

// Initialize the Parse SDK.
Parse.initialize(this, "__REMOVED KEY FOR SECURITY___", "__REMOVED KEY FOR SECURITY___");


// Specify an Activity to handle all pushes by default.

PushService.setDefaultPushCallback(this, SplashActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
}

还有我的 list :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bordengrammar.bordengrammarapp"
android:versionCode="1"
android:versionName="1" >

<!-- OpenGL For Map -->

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<!-- Permmisions -->

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />

<!-- Maps -->

<permission
android:name="com.bordengrammar.bordengrammarapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

<uses-permission android:name="com.bordengrammar.bordengrammarapp.permission.MAPS_RECEIVE" />

<!-- Push notifcation -->

<permission
android:name="com.bordengrammar.bordengrammarapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />

<uses-permission android:name="com.bordengrammar.bordengrammarapp.permission.C2D_MESSAGE" />

<!-- Android 3.0+ -->

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />

<!-- Main settings for application -->

<application
android:name=".Application"
android:allowBackup="true"
android:description="@string/des"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Example" >

<!-- Splash screen -->
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:theme="@style/FullBleedTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<!-- Main Activity -->
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
</activity>

<!-- Push Stuff -->

<receiver
android:name=".BGSWidgetProvider"
android:icon="@drawable/ic_launcher"
android:label="BGS Widget" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.ALTERNATIVE" />
</intent-filter>
<intent-filter>
<action android:name="com.bordengrammar.bordengrammarapp.BGSWidgetService.MOODY" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_info" />
</receiver>


<!-- Other activitys -->

<activity
android:name=".AboutActivity"
android:label="@string/title_activity_about" >
</activity>
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings" >
</activity>
<activity android:name=".LinkActivity"
android:label="View Link" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="MainActivity" />
</activity>

<!-- Meta-data (keys etc) -->

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyB7Vi7qBh0Ui0jC5A_cJkeCG2-jB6mQJ0w" />

<activity
android:name=".TwitterActivity"
android:label="@string/title_activity_twitter"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="MainActivity" />
</activity>
<activity
android:name=".PrivacyActivity"
android:label="@string/title_activity_privacy"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="MainActivity" />
</activity>

<meta-data
android:name="com.crashlytics.ApiKey"
android:value="3100c5a6401376fafb134b3000e78233a9a7f693" />

<!-- For widget -->
<activity
android:name=".Licenses"
android:label="@string/title_activity_licenses"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="MainActivity" />
</activity>








<!-- Push Service -->
<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.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.GcmBroadcastReceiver"
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.bordengrammar.bordengrammarapp" />
</intent-filter>
</receiver>
</application>

</manifest>

最佳答案

我遇到了同样的问题。问题是,当我调用云函数时,“params”参数为空。当我给它赋值时,问题就解决了。

关于java - 每次推送获取多个通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24393027/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com