Skip to content

Commit

Permalink
Remove google code (#946)
Browse files Browse the repository at this point in the history
* refactor(INJI-430): remove google nearby and firebase code

Signed-off-by: adityankannan-tw <[email protected]>

* refactor(INJI-430): update readme

Signed-off-by: adityankannan-tw <[email protected]>

* Update sonar-project.properties

---------

Signed-off-by: adityankannan-tw <[email protected]>
  • Loading branch information
adityankannan-tw authored Oct 19, 2023
1 parent f80a039 commit 1213201
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 108 deletions.
2 changes: 0 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ MIMOTO_HOST=https://api.qa-inji.mosip.net

ESIGNET_HOST=https://api.qa-inji.mosip.net

GOOGLE_NEARBY_MESSAGES_API_KEY=

OBSRV_HOST = https://dataset-api.obsrv.mosip.net

#Application Theme can be ( orange | purple )
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,9 @@ Create a `.env.local` file using `.env` as your template:

```
MIMOTO_HOST=
GOOGLE_NEARBY_MESSAGES_API_KEY=
```

And `android/local.properties`:

```
GOOGLE_NEARBY_MESSAGES_API_KEY=
```

More info here: [Setup Google Nearby Messages in React](https://github.com/mrousavy/react-native-google-nearby-messages#usage)
And `android/local.properties`.

### Android

Expand Down
18 changes: 2 additions & 16 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ plugins {
}

apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: "com.facebook.react"

import com.android.build.OutputFile
Expand Down Expand Up @@ -121,7 +119,6 @@ android {

manifestPlaceholders = [
APP_NAME: APP_NAME_RELEASE,
GOOGLE_NEARBY_MESSAGES_API_KEY: "${properties.getProperty('GOOGLE_NEARBY_MESSAGES_API_KEY')}",
appAuthRedirectScheme: 'io.mosip.residentapp.inji'
]
}
Expand Down Expand Up @@ -250,20 +247,9 @@ dependencies {
} else {
implementation jscFlavor
}
// Firebase
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'
implementation 'com.google.firebase:firebase-analytics:18.0.2'

implementation 'com.jakewharton.timber:timber:4.7.1'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "./eas-build.gradle"

try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
apply from: "./eas-build.gradle"
39 changes: 0 additions & 39 deletions android/app/google-services.json

This file was deleted.

Binary file removed android/app/google-services.json.gpg
Binary file not shown.
Binary file removed android/app/mosip-google-services.json.gpg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import timber.log.Timber;

import com.facebook.react.bridge.JSIModulePackage;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.crashlytics.FirebaseCrashlytics;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
Expand Down Expand Up @@ -77,36 +75,9 @@ public void onCreate() {
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
}
// Setup Firebase
FirebaseAnalytics.getInstance(this);
Timber.plant(new CrashReportingTree());
ApplicationLifecycleDispatcher.onApplicationCreate(this);
}


/**
* A tree which logs important information for crash reporting.
*/
private static class CrashReportingTree extends Timber.Tree {
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
@Override
protected void log(int priority, String tag, @NonNull String message, Throwable t) {
if (priority == Log.VERBOSE || priority == Log.DEBUG) {
return;
}

crashlytics.setCustomKey("priority", priority);
crashlytics.setCustomKey("tag", tag);
crashlytics.log(message);

if (t != null) {
if (priority == Log.ERROR) {
crashlytics.recordException(t);
}
}
}
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
2 changes: 0 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
Expand Down
12 changes: 1 addition & 11 deletions shared/constants.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import {Platform} from 'react-native';
import {
MIMOTO_HOST,
ESIGNET_HOST,
GOOGLE_NEARBY_MESSAGES_API_KEY,
DEBUG_MODE,
} from 'react-native-dotenv';
import {MIMOTO_HOST, ESIGNET_HOST, DEBUG_MODE} from 'react-native-dotenv';
import {Argon2iConfig} from './commonUtil';
import {VcIdType} from '../types/vc';

Expand All @@ -31,11 +26,6 @@ export const ACTIVITY_LOG_STORE_KEY = 'activityLog';

export const SETTINGS_STORE_KEY = 'settings';

export const GNM_API_KEY = GOOGLE_NEARBY_MESSAGES_API_KEY;

// https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/Message#MAX_CONTENT_SIZE_BYTES
export const GNM_MESSAGE_LIMIT = 102400 - 6400; // allowance for metadata

export const APP_ID_LENGTH = 12;

// Numbers and Upper case Alphabets without confusing characters like 0, 1, 2, I, O, Z
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sonar.projectKey=mosip_inji
sonar.organization=mosip
sonar.exclusions=.github/**, .vscode/**, android/**, assets/**, build/**, ios/**, node_modules/**, scripts/**
sonar.exclusions=.github/**, .vscode/**, android/**, assets/**, build/**, ios/**, node_modules/**, scripts/**, **/*.java

0 comments on commit 1213201

Please sign in to comment.