Push notifications: Spike for Android

- Print FCMToken which can be used to send PNs from Firebase Console
- Include react-native-fcm and related packages
- Update capabilities for iOS
- google service config files for Android and iOS
This commit is contained in:
Oskar Thorén 2017-08-30 11:34:30 +02:00
parent b7a9c9dc94
commit e169949e0a
22 changed files with 434 additions and 116 deletions

2
.gitignore vendored
View File

@ -30,7 +30,7 @@ project.xcworkspace
.idea
.gradle
local.properties
status-im.iml
*.iml
# node.js
#

View File

@ -30,6 +30,7 @@
"react-native-image-crop-picker",
"react-native-webview-bridge",
"react-native-drawer-layout",
"react-native-fcm",
"homoglyph-finder",
"web3",
"eccjs",

View File

@ -163,6 +163,7 @@ android {
dependencies {
compile project(':react-native-svg')
compile project(':react-native-mapbox-gl')
compile 'com.android.support:multidex:1.0.1'
compile project(':react-native-http-bridge')
compile project(':nfc-react-native')
@ -186,9 +187,10 @@ dependencies {
compile project(':react-native-fs')
compile project(':react-native-image-crop-picker')
compile project(':react-native-webview-bridge')
compile project(':reactnativemapboxgl')
compile 'testfairy:testfairy-android-sdk:1.+@aar'
compile project(':react-native-config')
compile project(':react-native-fcm')
compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
compile fileTree(dir: "node_modules/realm/android/libs", include: ["*.jar"])
}
@ -199,3 +201,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
into 'libs'
}
// Must be at bottom to avoid dependency collision
apply plugin: "com.google.gms.google-services"

View File

@ -0,0 +1,42 @@
{
"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": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

View File

@ -54,6 +54,19 @@
android:exported="true"/>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
<service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService"/>
<service android:name="com.evollu.react.fcm.MessagingService" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name="com.evollu.react.fcm.InstanceIdService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
</application>
</manifest>

View File

@ -8,6 +8,8 @@ import com.cboy.rn.splashscreen.SplashScreenReactPackage;
import com.centaurwarchief.smslistener.SmsListenerPackage;
import com.facebook.react.ReactApplication;
import com.horcrux.svg.SvgPackage;
import com.mapbox.reactnativemapboxgl.ReactNativeMapboxGLPackage;
import com.evollu.react.fcm.FIRMessagingPackage;
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
@ -26,7 +28,6 @@ import fr.bamlab.rnimageresizer.ImageResizerPackage;
import im.status.ethereum.module.StatusPackage;
import io.realm.react.RealmReactPackage;
import me.alwx.HttpServer.HttpServerReactPackage;
import com.mapbox.reactnativemapboxgl.ReactNativeMapboxGLPackage;
import java.util.ArrayList;
import java.util.Arrays;
@ -44,7 +45,9 @@ public class MainApplication extends MultiDexApplication implements ReactApplica
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new ArrayList<ReactPackage>(Arrays.asList(
new MainReactPackage(),
new SvgPackage(),
new SvgPackage(),
new ReactNativeMapboxGLPackage(),
new FIRMessagingPackage(),
new HttpServerReactPackage(),
new NfcReactNativePackage(),
new SplashScreenReactPackage(),
@ -63,9 +66,8 @@ public class MainApplication extends MultiDexApplication implements ReactApplica
new ImageResizerPackage(),
new PickerPackage(),
new WebViewBridgePackage(BuildConfig.DEBUG),
new ReactNativeMapboxGLPackage(),
new ReactNativeConfigPackage()
));
));
if (!BuildConfig.DEBUG) {
packages.add(new RNInstabugReactnativePackage("b239f82a9cb00464e4c72cc703e6821e", MainApplication.this, "shake"));

View File

@ -6,6 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@ -2,6 +2,10 @@ rootProject.name = 'StatusIm'
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-mapbox-gl'
project(':react-native-mapbox-gl').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mapbox-gl/android')
include ':react-native-fcm'
project(':react-native-fcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fcm/android')
include ':app'
include ':react-native-http-bridge'
project(':react-native-http-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-http-bridge/android')
@ -44,8 +48,5 @@ project(':react-native-image-crop-picker').projectDir = new File(settingsDir, '.
include ':react-native-webview-bridge'
project(':react-native-webview-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview-bridge/android')
include ':reactnativemapboxgl'
project(':reactnativemapboxgl').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mapbox-gl/android')
include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-3940256099942544/2934735716</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-3940256099942544/4411468910</string>
<key>CLIENT_ID</key>
<string>854811651919-30s20e3l0me0ins0vc4185jbnj7ja49o.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.854811651919-30s20e3l0me0ins0vc4185jbnj7ja49o</string>
<key>API_KEY</key>
<string>AIzaSyCwlaE5cnsT4rmGyOFxE39FlPVyKQ_2Mdo</string>
<key>GCM_SENDER_ID</key>
<string>854811651919</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>im.status.ethereum</string>
<key>PROJECT_ID</key>
<string>status-react-app</string>
<key>STORAGE_BUCKET</key>
<string>status-react-app.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<true/>
<key>IS_ANALYTICS_ENABLED</key>
<false/>
<key>IS_APPINVITE_ENABLED</key>
<false/>
<key>IS_GCM_ENABLED</key>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true/>
<key>GOOGLE_APP_ID</key>
<string>1:854811651919:ios:11ee7444ded8a00a</string>
<key>DATABASE_URL</key>
<string>https://status-react-app.firebaseio.com</string>
</dict>
</plist>

View File

@ -1,6 +1,15 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
# Need to explicitly declare this avoid downgrade
# https://github.com/evollu/react-native-fcm/issues/420
pod 'Firebase/Core', '4.0.0'
# react-native-fcm should support FB 4, but latest breaks builds, hence older version
# TODO(oskarth): Awaiting RN 0.47 upgrade, and/or PN working on iOS device before deciding which version to use
pod 'Firebase/Messaging'
#pod 'Firebase/Messaging', '3.17.0'
target 'StatusIm' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!

View File

@ -1,12 +1,47 @@
PODS:
- Firebase/Core (4.0.0):
- FirebaseAnalytics (= 4.0.0)
- FirebaseCore (= 4.0.0)
- Firebase/Messaging (4.0.0):
- Firebase/Core
- FirebaseMessaging (= 2.0.0)
- FirebaseAnalytics (4.0.0):
- FirebaseCore (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseCore (4.0.0):
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseInstanceID (2.0.0):
- FirebaseCore (~> 4.0)
- FirebaseMessaging (2.0.0):
- FirebaseAnalytics (~> 4.0)
- FirebaseCore (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/Logger (~> 2.1)
- Protobuf (~> 3.1)
- GoogleToolboxForMac/Defines (2.1.1)
- GoogleToolboxForMac/Logger (2.1.1):
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/NSData+zlib (2.1.1):
- GoogleToolboxForMac/Defines (= 2.1.1)
- Instabug (7.2.6)
- Protobuf (3.3.0)
DEPENDENCIES:
- Firebase/Core (= 4.0.0)
- Firebase/Messaging
- Instabug (~> 7.0)
SPEC CHECKSUMS:
Firebase: 284eea779b73fdff309791817da7c68bff8dd572
FirebaseAnalytics: 6f08e746f7d66f5452931bc2e822b5df9c66b64a
FirebaseCore: 85ad466044c2f013cdb167f85d426d15b128114a
FirebaseInstanceID: 9fbf536668f4d3f0880e7438456dabd1376e294b
FirebaseMessaging: 227406c05b0dc9290702d2e9f18ab5528f0c2cf2
GoogleToolboxForMac: 8e329f1b599f2512c6b10676d45736bcc2cbbeb0
Instabug: 49d4fbf1bf14e2f9074dfb7774ca5611bae993b4
Protobuf: d582fecf68201eac3d79ed61369ef45734394b9c
PODFILE CHECKSUM: b75d6ec95102ddea68ad1e171f7f8f974533bac7
PODFILE CHECKSUM: 11992cf30b55e1387c6201ced321cae502e7ebe3
COCOAPODS: 1.3.1

View File

@ -34,6 +34,7 @@
3E15DFEC1F6F4D7CAE088F49 /* libTcpSockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A4E93F6B154AEFA3485B45 /* libTcpSockets.a */; };
4D3D740D5EFA4F8592B048D7 /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DF1CD4C3D1254774ACCAE4E8 /* libBVLinearGradient.a */; };
4FFAE7B0414A463991039A2E /* libRNRandomBytes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C55F15EB4D4DAF9202A662 /* libRNRandomBytes.a */; };
5974D2035B8B47E0946B63B6 /* libRNFIRMessaging.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F752F17B1E04216B1337A72 /* libRNFIRMessaging.a */; };
5F8585D411844E5981B94F40 /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EC426A98043452BB6F9C134 /* libRNInstabug.a */; };
67F099D82798449FADF8358A /* libRCTOrientation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5535217F57E44D77AA9CF083 /* libRCTOrientation.a */; };
6CE6374707AC4EC788354DD1 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 11632AA0A5F84F029DD91797 /* libRNVectorIcons.a */; };
@ -42,6 +43,7 @@
82E689BAF9FB43C8AC6FF1CA /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CEB0E2659D1A4F5FA842057A /* EvilIcons.ttf */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
8E55E6877F950B81C8D711C5 /* libPods-StatusIm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 101A4045637A2ADF57D28EF5 /* libPods-StatusIm.a */; };
92A0DF7D1F4DE3A4002051BC /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 92A0DF491F4DE3A0002051BC /* GoogleService-Info.plist */; };
9E0B01A11DDC5DA7002B0359 /* SF-UI-Text-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9E0B01A01DDC5DA7002B0359 /* SF-UI-Text-Light.otf */; };
9E3AB6D01D87DB2B008846B4 /* libReact-Native-Webview-Bridge.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E3AB6C61D87DA2B008846B4 /* libReact-Native-Webview-Bridge.a */; };
9E54D6001F17A5DB009F0C16 /* libTestFairy.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E54D5FD1F17A5DB009F0C16 /* libTestFairy.a */; };
@ -70,6 +72,7 @@
CE4E31B31D8695250033ED64 /* Statusgo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE4E31B21D8695250033ED64 /* Statusgo.framework */; };
D28AEFB4C39548EB80416889 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52E205D210BC48B7A553BB62 /* Entypo.ttf */; };
E0AD9E8F495A4907B65104BF /* libRCTImageResizer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BEE3436791D42248F853999 /* libRCTImageResizer.a */; };
EE99697599F14E309CD2D44C /* libRCTMapboxGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2E945DF3D3D4E58845B95DA /* libRCTMapboxGL.a */; };
EF2B5857B4A34E0C9707FB3F /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B3B19223008342D096AA356E /* Octicons.ttf */; };
F9238D6C1E5F055900C047B9 /* SF-UI-Text-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = F9238D6B1E5F055900C047B9 /* SF-UI-Text-Semibold.otf */; };
FD4F213C3873473CB703B1D2 /* libRNFS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 674B3D9595A047AB8D518F4E /* libRNFS.a */; };
@ -245,6 +248,27 @@
remoteGlobalIDString = 58B5119B1A9E6C1200147676;
remoteInfo = RCTText;
};
922C4C4A1F4D5C3F0033C753 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F89A8F8005874B86B63C22E3 /* RNFIRMessaging.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RNFIRMessaging;
};
922C4D2D1F4D8EBB0033C753 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2C513ED88AE849F8A4CA3475 /* RCTMapboxGL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C5DBB3401AF2EF2B00E611A9;
remoteInfo = RCTMapboxGL;
};
922C4D2F1F4D8EBB0033C753 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2C513ED88AE849F8A4CA3475 /* RCTMapboxGL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C5DBB34B1AF2EF2B00E611A9;
remoteInfo = RCTMapboxGLTests;
};
9E3AB6C51D87DA2B008846B4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9E3AB6B21D87DA2A008846B4 /* React-Native-Webview-Bridge.xcodeproj */;
@ -464,6 +488,7 @@
20B6B6861D92C42600CC5C6A /* QBImagePicker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = QBImagePicker.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2756305FAFF144C4A6B0A039 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = "<group>"; };
2BEE3436791D42248F853999 /* libRCTImageResizer.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTImageResizer.a; sourceTree = "<group>"; };
2C513ED88AE849F8A4CA3475 /* RCTMapboxGL.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTMapboxGL.xcodeproj; path = "../node_modules/react-native-mapbox-gl/ios/RCTMapboxGL.xcodeproj"; sourceTree = "<group>"; };
305F194186D848FDB07AF34C /* RNFS.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFS.xcodeproj; path = "../node_modules/react-native-fs/RNFS.xcodeproj"; sourceTree = "<group>"; };
359B076A658B4FBAB5128B03 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = "<group>"; };
38A44830EC5708E89387F641 /* Pods-StatusIm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StatusIm.release.xcconfig"; path = "Pods/Target Support Files/Pods-StatusIm/Pods-StatusIm.release.xcconfig"; sourceTree = "<group>"; };
@ -485,10 +510,13 @@
78C55F15EB4D4DAF9202A662 /* libRNRandomBytes.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNRandomBytes.a; sourceTree = "<group>"; };
7B5870D9ED504F32B6A09C35 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; };
7ED174A34D7D42358313368B /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = "<group>"; };
7F752F17B1E04216B1337A72 /* libRNFIRMessaging.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFIRMessaging.a; sourceTree = "<group>"; };
807594C429CA44128AB5666B /* BVLinearGradient.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = BVLinearGradient.xcodeproj; path = "../node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj"; sourceTree = "<group>"; };
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
8AE71EE8751F4652B13BFE83 /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNVectorIcons.xcodeproj; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = "<group>"; };
8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
922C4CA61F4D5F8B0033C753 /* StatusIm.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = StatusIm.entitlements; path = StatusIm/StatusIm.entitlements; sourceTree = "<group>"; };
92A0DF491F4DE3A0002051BC /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
9E0B01A01DDC5DA7002B0359 /* SF-UI-Text-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Text-Light.otf"; sourceTree = "<group>"; };
9E3AB6B21D87DA2A008846B4 /* React-Native-Webview-Bridge.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "React-Native-Webview-Bridge.xcodeproj"; path = "../node_modules/react-native-webview-bridge/ios/React-Native-Webview-Bridge.xcodeproj"; sourceTree = "<group>"; };
9E54D5FD1F17A5DB009F0C16 /* libTestFairy.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libTestFairy.a; sourceTree = "<group>"; };
@ -508,6 +536,7 @@
B24FC7FE1DE7195F00D694FF /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
B2A5F42F1DEC36B200174F4D /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
B2DEA0A41E49E32000FA28D6 /* RCTHttpServer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTHttpServer.xcodeproj; path = "../node_modules/react-native-http-bridge/ios/RCTHttpServer.xcodeproj"; sourceTree = "<group>"; };
B2E945DF3D3D4E58845B95DA /* libRCTMapboxGL.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTMapboxGL.a; sourceTree = "<group>"; };
B2F2D1BB1D9D531B00B7B453 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = StatusIm/Images.xcassets; sourceTree = "<group>"; };
B3B19223008342D096AA356E /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = "<group>"; };
C2A4E93F6B154AEFA3485B45 /* libTcpSockets.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libTcpSockets.a; sourceTree = "<group>"; };
@ -518,6 +547,7 @@
DF1CD4C3D1254774ACCAE4E8 /* libBVLinearGradient.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libBVLinearGradient.a; sourceTree = "<group>"; };
F090E261B9854867A728CE4F /* RealmReact.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RealmReact.xcodeproj; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = "<group>"; };
F3548417D8DA4362B6796A54 /* RNInstabug.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNInstabug.xcodeproj; path = "../node_modules/instabug-reactnative/ios/RNInstabug.xcodeproj"; sourceTree = "<group>"; };
F89A8F8005874B86B63C22E3 /* RNFIRMessaging.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFIRMessaging.xcodeproj; path = "../node_modules/react-native-fcm/ios/RNFIRMessaging.xcodeproj"; sourceTree = "<group>"; };
F9238D6B1E5F055900C047B9 /* SF-UI-Text-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Text-Semibold.otf"; sourceTree = "<group>"; };
FC1CBCFE6C906043D6CCEEE1 /* libPods-StatusImTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-StatusImTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
1E74DC52A1E449A2BA858B14 /* RNSVG.xcodeproj */ = {isa = PBXFileReference; name = "RNSVG.xcodeproj"; path = "../node_modules/react-native-svg/ios/RNSVG.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
@ -578,6 +608,8 @@
9EE470541ED007E10048FD10 /* libRCTMapboxGL.a in Frameworks */,
9EF0836B1F3B53AB00876A8F /* libReactNativeConfig.a in Frameworks */,
B957A49EB0DE44D9A31CAF2D /* libRNSVG.a in Frameworks */,
5974D2035B8B47E0946B63B6 /* libRNFIRMessaging.a in Frameworks */,
EE99697599F14E309CD2D44C /* libRCTMapboxGL.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -664,6 +696,7 @@
13B07FAE1A68108700A75B9A /* StatusIm */ = {
isa = PBXGroup;
children = (
922C4CA61F4D5F8B0033C753 /* StatusIm.entitlements */,
9E54D5FD1F17A5DB009F0C16 /* libTestFairy.a */,
9E54D5FE1F17A5DB009F0C16 /* TestFairy.h */,
9E54D5FF1F17A5DB009F0C16 /* upload-dsym.sh */,
@ -876,6 +909,8 @@
5E5A7625B76441D984EA8C0D /* RCTImageResizer.xcodeproj */,
F3548417D8DA4362B6796A54 /* RNInstabug.xcodeproj */,
1E74DC52A1E449A2BA858B14 /* RNSVG.xcodeproj */,
F89A8F8005874B86B63C22E3 /* RNFIRMessaging.xcodeproj */,
2C513ED88AE849F8A4CA3475 /* RCTMapboxGL.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
@ -892,6 +927,7 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
92A0DF491F4DE3A0002051BC /* GoogleService-Info.plist */,
9EE470501ED0079E0048FD10 /* Mapbox.framework */,
9EE4701B1ED007190048FD10 /* RCTMapboxGL.xcodeproj */,
20B6B6861D92C42600CC5C6A /* QBImagePicker.framework */,
@ -917,6 +953,23 @@
name = Products;
sourceTree = "<group>";
};
922C4C211F4D5C3F0033C753 /* Products */ = {
isa = PBXGroup;
children = (
922C4C4B1F4D5C3F0033C753 /* libRNFIRMessaging.a */,
);
name = Products;
sourceTree = "<group>";
};
922C4D171F4D8EBB0033C753 /* Products */ = {
isa = PBXGroup;
children = (
922C4D2E1F4D8EBB0033C753 /* libRCTMapboxGL.a */,
922C4D301F4D8EBB0033C753 /* RCTMapboxGLTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
9E3AB6B31D87DA2A008846B4 /* Products */ = {
isa = PBXGroup;
children = (
@ -1072,6 +1125,14 @@
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = DTX7Z4U3YA;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
};
com.apple.Push = {
enabled = 1;
};
};
};
};
};
@ -1135,6 +1196,10 @@
ProductGroup = 9EE4701C1ED007190048FD10 /* Products */;
ProjectRef = 9EE4701B1ED007190048FD10 /* RCTMapboxGL.xcodeproj */;
},
{
ProductGroup = 922C4D171F4D8EBB0033C753 /* Products */;
ProjectRef = 2C513ED88AE849F8A4CA3475 /* RCTMapboxGL.xcodeproj */;
},
{
ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
@ -1183,6 +1248,10 @@
ProductGroup = 20B7D1251D3F74CD00B70F14 /* Products */;
ProjectRef = F090E261B9854867A728CE4F /* RealmReact.xcodeproj */;
},
{
ProductGroup = 922C4C211F4D5C3F0033C753 /* Products */;
ProjectRef = F89A8F8005874B86B63C22E3 /* RNFIRMessaging.xcodeproj */;
},
{
ProductGroup = 20B7D1161D3F74CD00B70F14 /* Products */;
ProjectRef = 305F194186D848FDB07AF34C /* RNFS.xcodeproj */;
@ -1382,6 +1451,27 @@
remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
922C4C4B1F4D5C3F0033C753 /* libRNFIRMessaging.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNFIRMessaging.a;
remoteRef = 922C4C4A1F4D5C3F0033C753 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
922C4D2E1F4D8EBB0033C753 /* libRCTMapboxGL.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTMapboxGL.a;
remoteRef = 922C4D2D1F4D8EBB0033C753 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
922C4D301F4D8EBB0033C753 /* RCTMapboxGLTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = RCTMapboxGLTests.xctest;
remoteRef = 922C4D2F1F4D8EBB0033C753 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
9E3AB6C61D87DA2B008846B4 /* libReact-Native-Webview-Bridge.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1583,6 +1673,7 @@
AE97D4B08C9F4821B8E9C50B /* Ionicons.ttf in Resources */,
0F942CF509F74CCDB5CB35B0 /* MaterialIcons.ttf in Resources */,
EF2B5857B4A34E0C9707FB3F /* Octicons.ttf in Resources */,
92A0DF7D1F4DE3A4002051BC /* GoogleService-Info.plist in Resources */,
74242ACAF37A48D0BFACDE82 /* Zocial.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -1802,6 +1893,8 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StatusIm.app/StatusIm";
@ -1841,6 +1934,8 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StatusIm.app/StatusIm";
@ -1854,6 +1949,7 @@
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_ENTITLEMENTS = StatusIm/StatusIm.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = DTX7Z4U3YA;
@ -1883,6 +1979,8 @@
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios",
"$(SRCROOT)/../node_modules/react-native-config/ios/**",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-fcm/ios",
"$(SRCROOT)/../node_modules/react-native-mapbox-gl/ios/**",
);
INFOPLIST_FILE = StatusIm/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@ -1909,6 +2007,7 @@
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_ENTITLEMENTS = StatusIm/StatusIm.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = DTX7Z4U3YA;
@ -1938,6 +2037,8 @@
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios",
"$(SRCROOT)/../node_modules/react-native-config/ios/**",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-fcm/ios",
"$(SRCROOT)/../node_modules/react-native-mapbox-gl/ios/**",
);
INFOPLIST_FILE = StatusIm/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;

View File

@ -9,7 +9,9 @@
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@import UserNotifications;
@interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate>
@property (nonatomic, strong) UIWindow *window;

View File

@ -14,6 +14,8 @@
#import "RCTRootView.h"
#import "SplashScreen.h"
#import "TestFairy.h"
#import "RNFIRMessaging.h"
#define NSLog(s, ...) do { NSLog(s, ##__VA_ARGS__); TFLog(s, ##__VA_ARGS__); } while (0)
@import Instabug;
@ -43,7 +45,30 @@
[TestFairy begin:@"969f6c921cb435cea1d41d1ea3f5b247d6026d55"];
}
[Instabug startWithToken:@"5534212f4a44f477c9ab270ab5cd2062" invocationEvent:IBGInvocationEventShake];
[FIRApp configure];
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
return YES;
}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
{
[RNFIRMessaging willPresentNotification:notification withCompletionHandler:completionHandler];
}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler
{
[RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
}
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
[RNFIRMessaging didReceiveLocalNotification:notification];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
[RNFIRMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
@end

View File

@ -1,91 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Status</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>im.status.ethereum</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>api.status.im</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for Instabug and Audio Messages</string>
<key>NSCameraUsageDescription</key>
<string>We need to access your camera</string>
<key>NSContactsUsageDescription</key>
<string>We need to access your contacts</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need to access your photo storage to give you an ability to select photos</string>
<key>UIAppFonts</key>
<array>
<string>RobotoMono-Medium.ttf</string>
<string>SF-UI-Text-Semibold.otf</string>
<string>SF-UI-Text-Bold.otf</string>
<string>SF-UI-Text-Regular.otf</string>
<string>SF-UI-Text-Medium.otf</string>
<string>SF-UI-Text-Light.otf</string>
<string>SF-UI-Display-Medium.otf</string>
<string>SF-UI-Display-Regular.otf</string>
<string>SF-UI-Display-Semibold.otf</string>
<string>SF-UI-Display-Thin.otf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>FontAwesome.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Status</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>im.status.ethereum</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>api.status.im</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSCameraUsageDescription</key>
<string>We need to access your camera</string>
<key>NSContactsUsageDescription</key>
<string>We need to access your contacts</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for Instabug and Audio Messages</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need to access your photo storage to give you an ability to select photos</string>
<key>UIAppFonts</key>
<array>
<string>RobotoMono-Medium.ttf</string>
<string>SF-UI-Text-Semibold.otf</string>
<string>SF-UI-Text-Bold.otf</string>
<string>SF-UI-Text-Regular.otf</string>
<string>SF-UI-Text-Medium.otf</string>
<string>SF-UI-Text-Light.otf</string>
<string>SF-UI-Display-Medium.otf</string>
<string>SF-UI-Display-Regular.otf</string>
<string>SF-UI-Display-Semibold.otf</string>
<string>SF-UI-Display-Thin.otf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>FontAwesome.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

31
package-lock.json generated
View File

@ -4,11 +4,6 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"Base64": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz",
"integrity": "sha1-ujpCMHCOGGcFBl5mur3Uw1z2ACg="
},
"abbrev": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz",
@ -963,6 +958,11 @@
"resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz",
"integrity": "sha1-eAqZyE59YAJgNhURxId2E78k9rs="
},
"Base64": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz",
"integrity": "sha1-ujpCMHCOGGcFBl5mur3Uw1z2ACg="
},
"base64-js": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz",
@ -4827,6 +4827,11 @@
"string.fromcodepoint": "0.2.1"
}
},
"react-native-fcm": {
"version": "7.5.1",
"resolved": "https://registry.npmjs.org/react-native-fcm/-/react-native-fcm-7.5.1.tgz",
"integrity": "sha1-NAK/CkhjwsUuKZhadlCtoeDLyFo="
},
"react-native-fs": {
"version": "2.1.0-rc.1",
"resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.1.0-rc.1.tgz",
@ -4963,9 +4968,9 @@
"integrity": "sha1-Eax0iB8tu2QFktex5g1HKVhVAxQ="
},
"react-native-tcp": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/react-native-tcp/-/react-native-tcp-3.2.2.tgz",
"integrity": "sha512-XN3A6a3vBZ7BMqI0jFBQedZfTztXlu20GjUgYlEp4Y1Yklr1xcl2tINRCi6KDXpYGByso0M6apNYMI9EzuD1Ug==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/react-native-tcp/-/react-native-tcp-3.3.0.tgz",
"integrity": "sha512-WAiL3IGhVxvmM0iw7/5ZRzdkiJBfBbLoFKNaHLJIsTZVqD/N5ZHUlJMjIQ+RrmB/f5nJ82bUEZ2vPCxe+rlNqQ==",
"requires": {
"base64-js": "0.0.8",
"buffer": "5.0.7",
@ -6080,6 +6085,11 @@
}
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
},
"string-range": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/string-range/-/string-range-1.2.2.tgz",
@ -6100,11 +6110,6 @@
"resolved": "https://registry.npmjs.org/string.fromcodepoint/-/string.fromcodepoint-0.2.1.tgz",
"integrity": "sha1-jZeDM8C8klOPUPOD5IiPPlYZ1lM="
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
},
"stringstream": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",

View File

@ -57,6 +57,7 @@
"react-native-dialogs": "0.0.16",
"react-native-drawer-layout": "1.1.3",
"react-native-emoji-picker": "git+https://github.com/alwx/react-native-emoji-picker.git",
"react-native-fcm": "7.5.1",
"react-native-fs": "2.1.0-rc.1",
"react-native-http": "github:tradle/react-native-http#834492d",
"react-native-http-bridge": "^0.4.1",
@ -112,7 +113,8 @@
"timers": "timers-browserify",
"tty": "tty-browserify",
"vm": "vm-browserify",
"net": "react-native-tcp"
"net": "react-native-tcp",
"fcm": "react-native-fcm"
},
"react-native": {
"crypto": "react-native-crypto",
@ -137,6 +139,7 @@
"timers": "timers-browserify",
"tty": "tty-browserify",
"vm": "vm-browserify",
"net": "react-native-tcp"
"net": "react-native-tcp",
"fcm": "react-native-fcm"
}
}

View File

@ -32,5 +32,6 @@
(def vector-icons (js/require "react-native-vector-icons/Ionicons"))
(def webview-bridge (js/require "react-native-webview-bridge"))
(def svg (js/require "react-native-svg"))
(def react-native-fcm (js/require "react-native-fcm"))

View File

@ -25,7 +25,8 @@
[status-im.ui.screens.chats-list.views.inner-item :refer [chat-list-item-inner-view]]
[status-im.ui.screens.chats-list.styles :as st]
[status-im.i18n :refer [label]]
[status-im.utils.platform :refer [platform-specific ios?]]))
[status-im.utils.platform :refer [platform-specific ios?]]
[status-im.utils.notifications :as notifications]))
(def android-toolbar-popup-options
[{:text (label :t/edit) :value #(dispatch [:set-in [:chat-list-ui-props :edit?] true])}])

View File

@ -26,6 +26,7 @@
[status-im.ui.screens.db :refer [app-db]]
[status-im.utils.config :as config]
[status-im.utils.crypt :as crypt]
[status-im.utils.notifications :as notifications]
[status-im.utils.handlers :refer [register-handler-db register-handler-fx]]
[status-im.utils.instabug :as inst]
[status-im.utils.platform :as platform]
@ -164,7 +165,8 @@
[:start-requesting-discoveries]
[:remove-old-discoveries!]
[:set :accounts/creating-account? false]
[:init-wallet]]}))
[:init-wallet]
[:get-fcm-token]]}))
(register-handler-fx
:check-console-chat
@ -264,3 +266,11 @@
:update-geolocation
(fn [db [_ geolocation]]
(assoc db :geolocation geolocation)))
;; TODO(oskarth): Put this token in DB
(register-handler-fx
:get-fcm-token
(fn [_ _]
(notifications/get-fcm-token)
{}))

View File

@ -0,0 +1,10 @@
(ns status-im.utils.notifications
(:require [status-im.react-native.js-dependencies :as rn]))
;; Work in progress namespace responsible for push notifications and interacting
;; with Firebase Cloud Messaging.
(defn get-fcm-token []
(let [fcm (aget rn/react-native-fcm "default")]
(.then ((.-getFCMToken fcm))
(fn [x] (println "*** FCM TOKEN" x)))))