Skip to content

Commit

Permalink
Merge pull request #18 from rapidpro/update-fcm
Browse files Browse the repository at this point in the history
Updates to use newer FCM
  • Loading branch information
nicpottier authored Dec 7, 2018
2 parents 30e928e + 9f07a1b commit e853922
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 51 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 26
buildToolsVersion '25.0.3'
buildToolsVersion '28.0.3'
useLibrary 'org.apache.http.legacy'

signingConfigs {
Expand Down Expand Up @@ -49,11 +49,11 @@ android {
}

dependencies {
compile files('libs/json_simple-1.1.jar')
compile 'com.android.support:support-core-utils:26+'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.android.support:support-v4:26+'

implementation files('libs/json_simple-1.1.jar')
implementation 'com.android.support:support-core-utils:26+'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.android.support:support-v4:26+'
}

apply plugin: 'com.google.gms.google-services'
9 changes: 0 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@
</intent-filter>
</service>

<service
android:name=".RapidProFirebaseRegistrationService"
android:permission="io.rapidpro.androidchannel.SERVICE_PERMISSION">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>


<service
android:name="io.rapidpro.androidchannel.SendMessageService"
android:enabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class RapidProFirebaseMessageService extends FirebaseMessagingService {

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
RapidPro.LOG.d("\n===FCM OnMessageReceived: " + remoteMessage.toString());

if (remoteMessage.getData().size() > 0) {

Expand All @@ -30,4 +31,12 @@ public void onMessageReceived(RemoteMessage remoteMessage) {
public void onSendError(String s, Exception e) {
RapidPro.LOG.d("\n===Error: for msg(" + s + ") " + e);
}
}


@Override
public void onNewToken(String token) {
RapidPro.LOG.d("\n===Registered: " +token);
SettingsActivity.setFCM(getApplicationContext(),token);
}

}

This file was deleted.

3 changes: 0 additions & 3 deletions app/src/main/res/xml/wakeful.xml

This file was deleted.

9 changes: 3 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}

allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Sep 12 11:13:28 CAT 2018
#Wed Nov 28 12:02:09 CAT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6 changes: 3 additions & 3 deletions packs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))


android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion 26
buildToolsVersion '28.0.3'

signingConfigs {
config {
Expand All @@ -33,7 +33,7 @@ android {
}

minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 26
}

buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion packs/buildpacks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ do
echo "Building pack $i"
export PACK_NUMBER=$i
../gradlew -PpackNumber=$i build
cp build/outputs/apk/packs-release.apk store/apks/pack$i.apk
cp build/outputs/apk/release/packs-release.apk store/apks/pack$i.apk
i=`expr $i + 1`
done

3 changes: 0 additions & 3 deletions packs/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
android:versionCode="5"
android:versionName="1.1" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="26" />

<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
Expand Down

0 comments on commit e853922

Please sign in to comment.