Skip to content

Commit

Permalink
Merge pull request #1 from jarseneault/crash_fix
Browse files Browse the repository at this point in the history
Crash fix
  • Loading branch information
korsarnsk committed Feb 22, 2015
2 parents e8210d2 + 92e0cd0 commit 6326148
Show file tree
Hide file tree
Showing 204 changed files with 35,307 additions and 33,104 deletions.
33 changes: 32 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,39 @@
<uses-permission android:name="$PACKAGE_NAME.permission.C2D_MESSAGE" />
</config-file>

<source-file src="src/android/parse/Parse-1.3.8.jar" target-dir="libs" framework="true" />
<source-file src="src/android/parse/bolts-android-1.1.4.jar" target-dir="libs" framework="true" />
<source-file src="src/android/parse/Parse-1.8.2.jar" target-dir="libs" framework="true" />
<source-file src="src/android/ParsePlugin.java" target-dir="src/org/apache/cordova/core" />
<!--<source-file src="src/android/ParseApplication.java" target-dir="src/org/apache/cordova/core" />-->

<info><![CDATA[
A couple of changes are needed to receive push notifications when the app is not
running on Android:
1. Edit your AndroidManifest.xml and add the following as an attribute on your
application tag:
android:name="org.apache.cordova.core.ParseApplication"
If you already have an application class (this is not common), you will need to
merge the code in ParseApplication.java with it instead.
2. Edit src/android/ParseApplication.java and change the following:
<%=app.id%>: Replace with your package identifier (i.e. com.example.appname)
<%=app.parse.app_id%>: Replace with your Parse App ID
<%=app.parse.client_key%>: Replace with your Parse Client Key
3. Edit plugin.xml and uncomment this line:
<!--<source-file src="src/android/ParseApplication.java" target-dir="src/org/apache/cordova/core" />-->
Without these changes, your app will crash when receiving push notifications
when it is not running.
If you have a build system, you may be able to automate this.
]]>
</info>
</platform>

<!-- ios -->
Expand Down
32 changes: 32 additions & 0 deletions src/android/ParseApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.apache.cordova.core;

import android.app.Application;
import android.content.Context;

import com.parse.Parse;
import com.parse.ParseInstallation;
import com.parse.PushService;

import <%=app.id%>.MainActivity;

public class ParseApplication extends Application
{
private static ParseApplication instance = new ParseApplication();

public ParseApplication() {
instance = this;
}

public static Context getContext() {
return instance;
}

@Override
public void onCreate() {
super.onCreate();
// register device for parse
Parse.initialize(this, "<%=app.parse.app_id%>", "<%=app.parse.client_key%>");
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
}
109 changes: 0 additions & 109 deletions src/android/parse/Parse-1.3.8-javadoc/allclasses-frame.html

This file was deleted.

109 changes: 0 additions & 109 deletions src/android/parse/Parse-1.3.8-javadoc/allclasses-noframe.html

This file was deleted.

Loading

0 comments on commit 6326148

Please sign in to comment.