Added Parse SDK.

This commit is contained in:
Dmitry Yunitsky 2015-06-05 14:56:11 +03:00 committed by Alex Zolotarev
parent f96e504e23
commit e3494fe5c4
8 changed files with 61 additions and 1 deletions

BIN
android/3rd_party/Parse-1.9.2.jar vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"
android:sharedUserId="com.mapswithme"
android:sharedUserLabel="@string/shared_user_label">
android:sharedUserLabel="@string/shared_user_label" xmlns:tools="http://schemas.android.com/tools">
<uses-sdk
android:minSdkVersion="9"/>
@ -48,6 +48,7 @@
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
<!-- -->
<supports-screens
android:largeScreens="true"
android:xlargeScreens="true"/>
@ -72,6 +73,10 @@
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/fb_app_id"/>
<meta-data
android:name="com.parse.push.notification_icon"
android:resource="@drawable/ic_notification"/>
<activity
android:name="com.mapswithme.maps.DownloadResourcesActivity"
android:configChanges="orientation|screenLayout|screenSize"
@ -281,6 +286,35 @@
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<!-- Parse -->
<service android:name="com.parse.PushService"/>
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.USER_PRESENT"/>
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
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"/>
</intent-filter>
</receiver>
<receiver
android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="${applicationId}"/>
</intent-filter>
</receiver>
</application>
</manifest>

View file

@ -30,6 +30,8 @@ dependencies {
// 3-party
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.2.0'
// for Parse SDK
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(dir: '3rd_party', include: '*.jar')
}

View file

@ -7,6 +7,10 @@
-dontwarn com.flurry.**
# support library bug
-dontwarn android.support.**
# parse
-dontwarn com.squareup.okhttp.**
-dontwarn okio.**
-dontwarn com.facebook.**
-dontoptimize
-keepattributes **

View file

@ -14,7 +14,10 @@ import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.util.Constants;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Yota;
import com.mapswithme.util.statistics.AlohaHelper;
import com.mapswithme.util.statistics.Statistics;
import com.parse.Parse;
import com.parse.ParseInstallation;
import java.io.File;
@ -122,6 +125,8 @@ public class MWMApplication extends android.app.Application implements ActiveCou
// init BookmarkManager (automatically loads bookmarks)
BookmarkManager.INSTANCE.getIcons();
initParse();
}
public String getApkPath()
@ -203,6 +208,18 @@ public class MWMApplication extends android.app.Application implements ActiveCou
public native void nativeSetString(String name, String value);
/*
* init Parse SDK
*/
private void initParse()
{
Parse.initialize(this, "***REMOVED***", "***REMOVED***");
ParseInstallation.getCurrentInstallation().saveInBackground();
org.alohalytics.Statistics.logEvent(AlohaHelper.PARSE_INSTALLATION_ID, ParseInstallation.getCurrentInstallation().getInstallationId());
org.alohalytics.Statistics.logEvent(AlohaHelper.PARSE_DEVICE_TOKEN, ParseInstallation.getCurrentInstallation().getString("deviceToken"));
}
public void initStats()
{
if (!mAreStatsInitialised)

View file

@ -54,4 +54,7 @@ public class AlohaHelper
public static final String ROUTING_GO_CLOSE = "routeGoClose";
// search
public static final String SEARCH_CANCEL = "searchCancel";
// installation of Parse
public static final String PARSE_INSTALLATION_ID = "Android_Parse_Installation_Id";
public static final String PARSE_DEVICE_TOKEN = "Android_Parse_Device_Token";
}