相关疑难解决方法(0)

华为手机上的"受保护的应用程序"设置,以及如何处理它

我有一台带有Android 5.0的华为P8用于测试应用程序.该应用程序需要在后台运行,因为它跟踪BLE区域.

我发现华为内置了一个名为Protected Apps的"功能",可以通过手机设置(电池管理器>受保护的应用程序)进行访问.这允许选定的应用程序在屏幕关闭后继续运行.

对华为来说很明智,但不幸的是,对于我来说,它看起来像是选择加入,即默认情况下应用程序已经关闭,你必须手动将它们放入.这不是一个showstopper,因为我可以在常见问题解答或打印中建议用户关于修复的文档,但我最近安装了Tinder(用于研究目的!),并注意到它被自动放入受保护的列表中.

有谁知道我的应用程序如何做到这一点?它是清单中的设置吗?这是华为为Tinder启用的东西,因为它是一个受欢迎的应用程序?

android android-manifest

129
推荐指数
4
解决办法
6万
查看次数

当应用程序从多任务托盘停止时,Android应用程序未收到Firebase通知

我在SO上读过类似的问题,然而,我无法从中得到正确的答案.

我有一个系统,我们向大约500个设备发送通知.

不幸的是,许多这些设备没有收到通知.我发现OPPO F1系列手机特别没有收到通知.

我发现,如果应用程序从多任务托盘中停止,则会发生这种情况.我该如何解决这个问题?

更新:我观察到当我从任务托盘关闭应用程序时,我的应用程序被强制停在应用程序管理器中.当我从任务托盘关闭Whatsapp时,仍然没有强制停止.怎么被Whatsapp处理?

android firebase firebase-cloud-messaging firebase-notifications

67
推荐指数
3
解决办法
4万
查看次数

错误广播意图回调:result = CANCELED forIntent {act = com.google.android.c2dm.intent.RECEIVE pkg = com.flagg327.guicomaipu(has extras)}

我从Android Studio的Android Monitor收到了这个错误.当我通过GCM在真实设备中发送推送通知并且应用尚未启动或已被迫停止时,会出现此错误.昨天一切正常,今天根本不起作用(仅当应用程序在后台或前台运行时才有效).

我认为这可能是一个AndroidManifest错误,但我厌倦了寻找问题而找不到任何东西.

表现

<manifest 
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.flagg327.guicomaipu">

    ...

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        ...

        <!--GOOGLE CLOUD MESSAGE-->
        <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <!-- for Gingerbread GSF backward compat -->
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="com.flagg327.guicomaipu" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.flagg327.guicomaipu.gcm.RegistrationService"
            android:exported="false" />

        <service
            android:name="com.flagg327.guicomaipu.gcm.TokenRefreshListenerService"
        android:exported="false">
            <intent-filter>
                <action
                    android:name="com.google.android.gms.iid.InstanceID" />
            </intent-filter>
        </service>

        <service
            android:name="com.flagg327.guicomaipu.gcm.NotificacionsListenerService"
        android:exported="false" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>

    </aplication>

    <permission 
        android:name="com.flagg327.guicomaipu.C2D_MESSAGE"
            android:protectionLevel="signature" />
    <uses-permission android:name="com.flagg327.guicomaipu.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" …
Run Code Online (Sandbox Code Playgroud)

android push-notification google-cloud-messaging

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