Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plan for doing push amplification? #956

Closed
rameshvoltella opened this issue Feb 19, 2020 · 5 comments
Closed

Any plan for doing push amplification? #956

rameshvoltella opened this issue Feb 19, 2020 · 5 comments

Comments

@rameshvoltella
Copy link

Hi,
This is a question,Any plan to add push amplification technique which done by cleavetap,mobengage people to make delivery on chines oems and othe manufature which kills the app?if possible please try to add this in future relases.

mobengage

cleaver tap

@rameshvoltella
Copy link
Author

@jkasten2 any plans

@jkasten2
Copy link
Member

jkasten2 commented Feb 25, 2020

@rameshvoltella "Push Amplification" isn't a defined standard, each of the descriptions are different between vendors so each of them cover different scopes.

What is the most important feature(s) to you?

1. Providing a list of notifications when the user opens your app

A. Notifications not shown due to notification permission being disabled. (app level)
B. Notifications sent but never received by the device or app at all. (server level)

  • If this 1B option is important, would your notifications be targeted on a user, a segment, or to all?

2. Android - Show a notification even if your app is Force Stopped

This section is scoped to showing a notification on the device at the time of send when the app is in a Force Stopped / Force Killed state, part 1B above covers on app open already.

Let's start by defining when an app gets closed normally vs when an app would be Force Stopped / Force Killed.

2.1 When does an app close normally?

Normal closes, notifications still show in these cases:

  • Swiping away the app
  • Process being stopped by Android freeing RAM
  • Rebooting the device
  • App upgraded
  • System.exit called via code in the app

In these cases above your app process will closed but if push comes in your app will be started in the background to process the push payload and a notification will be shown.

2.2 When does an app become "Force Stopped"?

Force Stopped / Force Killed state doesn't happen under normal conditions.
Here is a list of ways an app can get into this state:

  • Going to Settings > Apps > "your app" > "Force stop"
  • Apps Force Stopped via managers such as Greenify
  • Non-Standard Android versions on Devices, under specific conditions
    • Includes Samsung, Sony, Xiaomi, Huawei, OnePlus, etc.
    • Results vary between device models and China vs International ROMs of these devices

2.3 Why pushes do not work on app is "Force Stopped"?

The "Google Play services" app on the device will first handle the push. Then it creates an Intent to your app. If your app is in a "Force Stopped" state then the Intent will never reach your app and is dropped by the Android OS itself.

2.4 When does an app leave the "Force Stopped"?

The only way an app can get out of the "Force Stopped" is if the user opens your app again from the home screen launcher.

When an app is "Force Stopped" all scheduled Alarms, Jobs, ect are canceled for the app. So these don't work to bring the app back out of this state. So this means a "backup polling" strategy is not possible either.

2.5 How to prevent my app from being "Force Stopped"?

Most of the non-standard versions of Android developed by these manufactures provide a way to whitelist apps to prevent their custom "Force Stopped" logic. The best thing you can do is instruct your users who are on these devices to whitelist your app if notifications and / or other background features are important to them.
See the following resources for more details on this.

3. Notification not shown due a blocked connection to FCM

A "backup polling" strategy would technically by possible if a connection to Google was being blocked, however it's highly discouraged due to a cost of battery drain along with resources (CPU, RAM, Data usage) to the device. The real world case for this I can see is if your user is in a county is that blocks Google, such as China. However a more correct solution to this issue would be to support push channels that work in the region, to avoid the device resource load.

@rameshvoltella
Copy link
Author

i need option 2 @jkasten2

@jkasten2
Copy link
Member

@rameshvoltella I have updated section 2 with a lot of extra detail on what a normal close is vs a Force Stopped as well as explain how it happens and recommendations on handling the "manufacturers which kills the app" question you had.

@rgomezp
Copy link
Contributor

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants