Skip to content

Commit

Permalink
Merge pull request #98 from OvalMoney/feature/update-android-sdk
Browse files Browse the repository at this point in the history
Feature/update android sdk
  • Loading branch information
franceto authored Apr 13, 2021
2 parents a65c3cf + 405bc5a commit f2aaaf7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 43 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ repositories {

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation "com.google.android.gms:play-services-fitness:${safeExtGet('fitnessPlayServices', '17.0.0')}"
implementation "com.google.android.gms:play-services-auth:${safeExtGet('authPlayServices', '17.0.0')}"
implementation "com.google.android.gms:play-services-fitness:${safeExtGet('fitnessPlayServices', '20.0.0')}"
implementation "com.google.android.gms:play-services-auth:${safeExtGet('authPlayServices', '19.0.0')}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,6 @@ public void disconnect(Promise promise){
}
}

@ReactMethod
public void subscribeToActivity(Promise promise){
try {
manager.subscribeToActivity(getCurrentActivity(), promise);
}catch(Error e){
promise.reject(e);
}
}

@ReactMethod
public void subscribeToSteps(Promise promise){
try {
Expand Down
23 changes: 0 additions & 23 deletions android/src/main/java/com/ovalmoney/fitness/manager/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,29 +211,6 @@ public void onFailure(@NonNull Exception e) {
@Override
public void onNewIntent(Intent intent) { }

public void subscribeToActivity(Context context, final Promise promise){
final GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(context);
if(account == null){
promise.resolve(false);
return;
}
Fitness.getRecordingClient(context, account)
.subscribe(DataType.TYPE_ACTIVITY_SAMPLES)
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
promise.resolve(true);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
promise.resolve(false);
}
});

}

public void subscribeToSteps(Context context, final Promise promise){
final GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(context);
if(account == null){
Expand Down
9 changes: 0 additions & 9 deletions js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,6 @@ export declare interface SleepAnalysisRecord {
* @return Promise<SleepAnalysisRecord[]>
*/
export declare function getSleepAnalysis(request: SleepAnalysisRequest): Promise<SleepAnalysisRecord[]>

/**
* Available only on Android.
*
* Subscribe to all Google Fit activities.
*
* @return Promise<boolean>
*/
export declare function subscribeToActivity(): Promise<boolean>

/**
* Available only on Android.
Expand Down

0 comments on commit f2aaaf7

Please sign in to comment.