How can I receive notification when app closed ?

When the app is close there isn't any notification that received. The only way the app can receive notification when it is open but when I clear the application like it show multitasking it doesn't receive notification at all.

This is a manifest.xml

<?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="school.jabjai.jabjaiapp">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:name=".urbanairship.NotificationApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />

<activity android:name=".SplashScreenActivity" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"
android:theme="@style/Theme.Transparent"/>

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" android:screenOrientation="portrait" />
<activity android:name=".ShowWeekViewActivity" android:screenOrientation="portrait" />
<activity android:name=".MainActivity" android:screenOrientation="portrait" />
<activity android:name=".signup.SignupActivity" android:screenOrientation="portrait" />

<!--
Optional: This is an example of one of the many ways to handle deep
linking in the application. To use with your application, update the data
scheme to be unique for the application and modify ParseDeepLinkActivity.parseDeepLink
method to match your application's deep link parsing
-->
<activity
android:name=".urbanairship.ParseDeepLinkActivity"
android:theme="@android:style/Theme.NoDisplay"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<!-- Handles any vnd.jabjai.jabjaiapp://deeplink URI's -->
<data
android:host="deeplink"
android:scheme="vnd.jabjai.jabjaiapp" />

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

<!-- OPTIONAL, if you want to receive push, push opened and registration completed intents -->
<!-- Replace the receiver below with your package and class name -->
<receiver
android:name=".urbanairship.SampleAirshipReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="com.urbanairship.push.CHANNEL_UPDATED" />
<action android:name="com.urbanairship.push.OPENED" />
<action android:name="com.urbanairship.push.RECEIVED" />
<action android:name="com.urbanairship.push.DISMISSED" />

<category android:name="${applicationId}" />
</intent-filter>

</receiver>

<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
tools:replace="android:theme" />

<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>

<service android:name=".badger.BadgeIntentService"
android:exported="false"></service>

</application>

</manifest>

How can I fix this problem ?
Let's me know.

Thank you.

 

Didn't find what you were looking for?

New post

Comments

8 comments

  • Hi Narin,

    When you say the app is closed, do you mean the app is in the background or do you mean it has been force stopped? It is expected behavior for a device to not receive push notifications from an app if the app has been force closed.

    If you aren't force stopping the app, let me know and I will investigate the issue further.

    Best regards,
    Jenn Miller

    0
  • Sorry for unclear question. I mean the app run is in background and the time user reboot a phone the app can't recieve a notification

    0
  • Please review this question and help me, please. 

    This function is necessary for my application. I wanna it hasn't any problem at all

     

    Best regards

    0
  • Hi Narin,

    To clarify, the app is running in the background after the phone has been turned on and off? 

    Could you send over the information listed in this article?

    This will help us ensure that your implementation is correct. You might also want to see if you can reproduce this behavior with our Android sample application.

    Best regards,
    Jenn

    0
  • The situation when I can receive notification is when the app is open in foreground and background before I swipe out the app from "recent app".

    When I swipe out the app on "recent app" it already can't receive a notification anymore.

    Something that I can notice about this when the app run on Xiaomi Red Mi3 the app work very well when I clear app cache it still working it can receive notification that send to its but when I run the app on Asus or Vivo smartphone when I clear cache (clear recent app) it doesn't still receive any notification anymore.

    How can I resolve this problem

     

    Thank you very much

    0
  • Hi Narin,

    It sounds like you are force closing the app, in which case notifications will not go through to the device. With that being said, it is odd that one of the devices is still receiving notifications after you've force closed it. Is the process for force closing the app the same on the Xiaomi Red Mi3 the same as it is for the Asus or Vivo smartphone?

    Best regards,

    Jenn Miller

    0
  • Hi Narin,

    I just wanted to check in and see if you were able to resolve this issue. If not, there is one more thing we can check - where are you calling takeOff? Are you calling it in an activity or autopilot? Background push will not work if takeOff is called in an activity, which is why I ask. 

     

    0
  • Why if whatsapp or other apps are force closed, they keep receiving notifications? How can we work around this issue?

    Thank you

    0

Please sign in to leave a comment.