Skip to content

Commit

Permalink
Fix to zero-config push notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowers committed Dec 21, 2012
1 parent 0b035e6 commit 30d9ec4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Binary file added MixpanelAPI_v2.2.2.jar
Binary file not shown.
8 changes: 4 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="MixpanelAPI_v2.2.1">
<project name="MixpanelAPI_v2.2.2">

<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Expand Down Expand Up @@ -99,11 +99,11 @@
</target>

<target name="library" depends="compile">
<jar destfile="MixpanelAPI_v2.2.1.jar"
<jar destfile="MixpanelAPI_v2.2.2.jar"
basedir="${out.classes.absolute.dir}"
includes="**/*.class" />
<copy file="MixpanelAPI_v2.2.1.jar" tofile="${demo.absolute.libs.dir}/MixpanelAPI_v2.2.1.jar" />
<copy file="MixpanelAPI_v2.2.1.jar" tofile="${test.absolute.libs.dir}/MixpanelAPI_v2.2.1.jar" />
<copy file="MixpanelAPI_v2.2.2.jar" tofile="${demo.absolute.libs.dir}/MixpanelAPI_v2.2.2.jar" />
<copy file="MixpanelAPI_v2.2.2.jar" tofile="${test.absolute.libs.dir}/MixpanelAPI_v2.2.2.jar" />
</target>

<target name="docs">
Expand Down
2 changes: 1 addition & 1 deletion src/com/mixpanel/android/mpmetrics/MixpanelAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
* @see <a href="https://github.com/mixpanel/sample-android-mixpanel-integration">The Mixpanel Android sample application</a>
*/
public class MixpanelAPI {
public static final String VERSION = "2.2.1";
public static final String VERSION = "2.2.2";

/**
* You shouldn't instantiate MixpanelAPI objects directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class NotificationBroadcastReceiver extends BroadcastReceiver {

String LOGTAG = "NotificationBroadcastReceiver";
private static String LOGTAG = "NotificationBroadcastReceiver";

@Override
public void onReceive(Context context, Intent intent) {
Expand All @@ -31,17 +31,20 @@ public void onReceive(Context context, Intent intent) {

/* package */ static synchronized void registerIfNeeded(Context registrationContext) {
if (sAlreadyRegistered.containsKey(registrationContext)) {
if (MPConfig.DEBUG) Log.d(LOGTAG, "NotificationBroadcastReceiver already registered");
return;
}

NotificationBroadcastReceiver registrar = new NotificationBroadcastReceiver();
IntentFilter registrations = new IntentFilter();
registrations.addAction("com.google.android.c2dm.intent.RECEIVE");
registrations.addAction("com.google.android.c2dm.intent.REGISTRATION");
registrations.addCategory("com.mixpanel.example.hello");
registrations.addCategory(registrationContext.getPackageName());

registrationContext.registerReceiver(registrar, registrations, "com.google.android.c2dm.permission.SEND", null);
sAlreadyRegistered.put(registrationContext, true);

if (MPConfig.DEBUG) Log.d(LOGTAG, "Registered to recieve notifications for package name " + registrationContext.getPackageName());
}


Expand Down

0 comments on commit 30d9ec4

Please sign in to comment.