Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
chore(gradle): update firebase sdk
Browse files Browse the repository at this point in the history
SUITEDEV-16072

Co-authored-by: pjozsef <9980358+pjozsef@users.noreply.github.com>
  • Loading branch information
megamegax and pjozsef committed Jan 22, 2019
1 parent 4db0899 commit 0d47dcd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.emarsys.mobileengage.sample"
minSdkVersion 14
Expand Down Expand Up @@ -48,8 +47,8 @@ dependencies {
// Getting a "Could not find firebase-core" error? Make sure you have
// the latest Google Repository in the Android SDK manager

compile 'com.android.support:design:26.0.2'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'

compile 'com.squareup.picasso:picasso:2.5.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
Expand All @@ -20,7 +21,10 @@
import com.emarsys.mobileengage.MobileEngage;
import com.emarsys.mobileengage.MobileEngageException;
import com.emarsys.mobileengage.MobileEngageStatusListener;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;

import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -153,22 +157,26 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

pushToken.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String pushToken = FirebaseInstanceId.getInstance().getToken();
ClipboardManager clipboard = (ClipboardManager) v.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
String toastMessage = pushToken;
if (clipboard != null) {
ClipData clip = ClipData.newPlainText("pushtoken", pushToken);
clipboard.setPrimaryClip(clip);
toastMessage = "Copied: " + toastMessage;
}
Toast.makeText(
v.getContext(),
toastMessage,
Toast.LENGTH_LONG).show();
public void onClick(final View view) {
FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
@Override
public void onComplete(@NonNull Task<InstanceIdResult> task) {
ClipboardManager clipboard = (ClipboardManager) view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
String pushToken = task.getResult().getToken();
String toastMessage = pushToken;
if (clipboard != null) {
ClipData clip = ClipData.newPlainText("pushtoken", pushToken);
clipboard.setPrimaryClip(clip);
toastMessage = "Copied: " + toastMessage;
}
Toast.makeText(
view.getContext(),
toastMessage,
Toast.LENGTH_LONG).show();
}
});
}
});

return root;
}

Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:3.1.0'

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -15,10 +16,8 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

0 comments on commit 0d47dcd

Please sign in to comment.