2
I have an application in Parse.com that sends Pushs with custom API messages to open an Activity, my Custom Receiver is like this:
public class CustomReceiver extends ParsePushBroadcastReceiver {
private static final String TAG = "PUSH";
@Override
public void onReceive(Context context, Intent intent) {
Intent i = new Intent(context, MyClass.class);
i.putExtras(intent.getExtras());
Log.d(TAG, intent.getExtras().getString("com.parse.Data"));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
@Override
protected void onPushOpen(Context context, Intent intent) {
Log.d(TAG,"OPEN PUSH");
ParseAnalytics.trackAppOpenedInBackground(intent);
}
On my manifest it’s like this:
<service android:name="com.parse.PushService" />
<receiver android:name="com.myapp.services.CustomReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.myapp.CustomAction" />
</intent-filter>
</receiver>
I get the ok Pushs and even opens the Activity MyClass.class
, but in the Parse panel I can’t see how many users opened the PUSH sent. I only see how many users were sent.
Matthew, could you run a test and use the
trackAppOpened(intent)
instead of the current one (I know you don’t want to stop theReceiver
, but it’s just like testing.ParseAnalytics
?– Wakim
Testei continued the same thing. Now I don’t understand your question about setting up Parseanalytcs @Wakim
– Mateus Carvalho
Is that to use the
ParseAnalytics
you need to include his jar in the project (should have already been done) and configure it in theonCreate
of hisApplication
. Can you verify that second item?– Wakim
The Analytcs . jar I didn’t add no to.. I just added the Compile 'com.parse.bolts:bolts-android:1.+ ' Compile fileTree(include: 'Parse-*.jar', dir: 'libs') As specified here https://www.parse.com/apps/quickstart#Analytics/Events/mobile/android/Native/existing
– Mateus Carvalho
But inside the briefcase
libs
has thejar
? My suggestion is you add thejar
if you do not have and initializeParseAnalytics
in theonCreate
.– Wakim
Parse SDK has no Parseanalytcs.jar.. @Wakim
– Mateus Carvalho
Hmm, I mistook it for the
ParseCrashReporting
. Looking at doc. is right the way you are using and you don’t even need to configure inApplication
. My mistake. In this case, you’re saving theParseInstallation
right?– Wakim
Let’s go continue this discussion in chat.
– Mateus Carvalho
@Wakim yes I am...
– Mateus Carvalho
It seems that the push open is bug.. I saw several people posting this on the Developers facebook forum..
– Mateus Carvalho