Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: re-integrate firebase #21983

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ TEST_NETWORKS_ENABLED=1
ENABLE_ALERT_BANNER=1
FLAG_WALLET_CONNECT_ENABLED=1
API_LOGGING_ENABLED=1
GOOGLE_FREE=0
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ build-fdroid: export BUILD_TYPE = release
build-fdroid: export ANDROID_ABI_SPLIT = false
build-fdroid: export ANDROID_ABI_INCLUDE = armeabi-v7a;arm64-v8a;x86;x86_64
build-fdroid: ##@build Build release for F-Droid
@scripts/google-free.sh
@scripts/build-android.sh

build-android: export BUILD_ENV ?= prod
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.32.0
2.32.21983
21 changes: 21 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = hermesEnabled.toBoolean();

/**
* Exclude google library so we can publish to external android stores
*/
def googleFree = project.env.get("GOOGLE_FREE", 0) == '1'

def getCommitHash = { ->
if (project.hasProperty("commitHash")) {
return project.commitHash
Expand Down Expand Up @@ -286,6 +291,18 @@ dependencies {
implementation(jscFlavor)
}

if (googleFree) {
implementation(project(':react-native-notifications')) {
exclude group: 'com.google.firebase'
// exclude group: 'com.google.gms'
}
} else {
implementation project(':react-native-notifications') {
// exclude group: 'com.google.gms'
}
implementation 'com.google.firebase:firebase-messaging:24.1.0'
}

// react-native-screens
implementation("androidx.appcompat:appcompat:1.1.0-rc01")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02")
Expand Down Expand Up @@ -335,3 +352,7 @@ task hemroidBuild(type: Exec) {
preBuild.dependsOn hemroidBuild

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

if (!googleFree) {
apply plugin: 'com.google.gms.google-services'
}
119 changes: 119 additions & 0 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"project_info": {
"project_number": "854811651919",
"firebase_url": "https://status-react-app.firebaseio.com",
"project_id": "status-react-app",
"storage_bucket": "status-react-app.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:854811651919:android:11ee7444ded8a00a",
"android_client_info": {
"package_name": "im.status.ethereum"
}
},
"oauth_client": [
{
"client_id": "854811651919-gua52csicclb5p9gr4eeu33ukk0aaphj.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAOF4W1j8GYeXzzVKRfNKlXywD6bx0rJtQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "854811651919-gua52csicclb5p9gr4eeu33ukk0aaphj.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "854811651919-30s20e3l0me0ins0vc4185jbnj7ja49o.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "im.status.ethereum"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:854811651919:android:15dbe4af1e06ca3e005f3a",
"android_client_info": {
"package_name": "im.status.ethereum.debug"
}
},
"oauth_client": [
{
"client_id": "854811651919-gua52csicclb5p9gr4eeu33ukk0aaphj.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAOF4W1j8GYeXzzVKRfNKlXywD6bx0rJtQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "854811651919-gua52csicclb5p9gr4eeu33ukk0aaphj.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "854811651919-30s20e3l0me0ins0vc4185jbnj7ja49o.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "im.status.ethereum"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:854811651919:android:1d0d69fe8c1bb89b005f3a",
"android_client_info": {
"package_name": "im.status.ethereum.pr"
}
},
"oauth_client": [
{
"client_id": "854811651919-gua52csicclb5p9gr4eeu33ukk0aaphj.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAOF4W1j8GYeXzzVKRfNKlXywD6bx0rJtQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "854811651919-gua52csicclb5p9gr4eeu33ukk0aaphj.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "854811651919-30s20e3l0me0ins0vc4185jbnj7ja49o.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "im.status.ethereum"
}
}
]
}
}
}
],
"configuration_version": "1"
}
6 changes: 6 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_paths" />
</provider>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/notification_icon" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/notification_icon_color" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import im.status.ethereum.keycard.RNStatusKeycardPackage
import im.status.ethereum.module.StatusPackage
import im.status.ethereum.pushnotifications.PushNotificationPackage
import im.status.ethereum.StatusOkHttpClientFactory
import com.wix.reactnativenotifications.RNNotificationsPackage;

class MainApplication : NavigationApplication() {

Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<color name="alert_text">#000000</color>
<color name="splash_background">#09101C</color>
<color name="splash_status_bar_color">#ffffff</color>
<color name="notification_icon_color">#4360DF</color>
</resources>
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ buildscript {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath("com.google.gms:google-services:4.4.2")
}
}

Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ project(':react-native-status-keycard').projectDir = new File(rootProject.projec
include ':react-native-blur'
project(':react-native-blur').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/blur/android')
includeBuild('../node_modules/@react-native/gradle-plugin')
include ':react-native-notifications'
project(':react-native-notifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/lib/android/app')
Loading