在android模拟器中,我尝试在终止模式下执行推送通知,但是在android设备中却无法正常工作

时间:2019-06-21 14:44:02

标签: android firebase firebase-cloud-messaging

在android模拟器中,我尝试以终止模式进行推送通知,但与android设备不同,它不起作用

我尝试将带有HTTP协议的通知推送到https://fcm.googleapis.com/fcm/send

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        package="id.sch.sman1garut.app.sman1garut">
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
        <uses-permission android:name="android.permission.GET_ACCOUNTS" />
        <uses-permission android:name="android.permission.READ_PROFILE" />
        <uses-permission android:name="android.permission.READ_CONTACTS" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

        <application
            tools:replace="android:icon"
            android:allowBackup="true"
            android:icon="@drawable/applogo"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
            <activity android:name=".SplashAct">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".GetStartedAct" />
            <activity android:name=".MasukAct" />
            <activity android:name=".DaftarAct" />
            <activity android:name=".Daftar2Act" />
            <activity android:name=".SuccessDaftarAct"></activity>
            <receiver android:enabled="true" android:name=".BootUpReceiver"
                android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </receiver>
            <service
                android:name=".utils.MyFirebaseInstanceIdService">
                <intent-filter>
                    <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
                </intent-filter>
            </service>
            <service
                android:name=".utils.MyFirebaseMessagingService">
                <intent-filter>
                    <action android:name="com.google.firebase.MESSAGING_EVENT"/>
                </intent-filter>
            </service>
        </application>

    </manifest>

when i put code, that's error, i dont know why

MyFirebaseMessagingService  https://pastebin.com/CCZU3aKT

MyFirebaseInstanceIdService  https://pastebin.com/SFxunE5w 通知不起作用

0 个答案:

没有答案