Tracking app opened due to push

625 Views Asked by At

The Android docs state that we need to call trackAppOpenedInBackground() from either:

  1. The main Activity's onCreate().

  2. The onReceive() method of the BroadcastReceiver which handles the OPEN intent.

This raises a problem with opening the push when the app is the background:

  1. If we implement the call on the onCreate() method - it will not be tracked.

  2. If we implement it on the onReceive(), it will ONLY be called on push opens, not on regular app open.

  3. If we implement on both, we get double reports.

On the iOS platform this is handled correctly - push clicks when the app is in the background are registered, but no double rports.

So - how should we implement this on the Android platform?

Thanks, Vaiden

2

There are 2 best solutions below

0
On BEST ANSWER

Oh well - we've decided we probably don't and shouldn't care about app opens.

We track sessions using Google Analytics anyway, so the key metric that we care about on Parse.com is the push interaction. So we've implemented the tracking code on BOTH the suggested locations.

2
On

Actually, one receives double activations on iOS as well. Simply managed by tracking the unique id assigned to each push (which you are responsible for) upon receiving the push.. prior to acting on any push, just check the tracking collection; if found, don't act.