@dashx/react-native v1.0.8
@dashx/react-native
DashX SDK for React Native
Install
npm
npm install @dashx/react-nativeyarn
yarn add @dashx/react-nativeSetup for Android
DashX requires Google Services installed in your app for Firebase to work:
- Add
google-servicesplugin in your/android/build.gradle
buildscript {
dependencies {
// ... other dependencies
classpath 'com.google.gms:google-services:4.3.3'
}
}- Add this line in your
/android/app/build.gradle
apply plugin: 'com.google.gms.google-services'Add your Android app on Firebase Console:
Project Overview > Add App > AndroidDownload
google-services.jsonfrom there.Add
google-services.jsonat the following location:/android/app/google-services.json
Setup for iOS
- At the top of the file
/ios/{projectName}/AppDelegate.mbefore #if defined(FB_SONARKIT_ENABLED), import Firebase:
#import <FirebaseCore/FirebaseCore.h>
#import <FirebaseMessaging/FirebaseMessaging.h>- In the same file, inside your
didFinishLaunchingWithOptionsadd this:
// Register for remote notifications. This shows a permission dialog on first run, to
// show the dialog at a more appropriate time move this registration accordingly.
// [START register_for_notifications]
[UNUserNotificationCenter currentNotificationCenter].delegate = self;
UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
[[UNUserNotificationCenter currentNotificationCenter]
requestAuthorizationWithOptions:authOptions
completionHandler:^(BOOL granted, NSError * _Nullable error) {
}];
[application registerForRemoteNotifications];
// [END register_for_notifications]
// [START configure_firebase]
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
// [END configure_firebase]
// [START set_messaging_delegate]
[FIRMessaging messaging].delegate = self;
// [END set_messaging_delegate]- In your
Podfileadd this:
pod 'FirebaseMessaging', :modular_headers => trueAdd your iOS app on Firebase Console:
Project Overview > Add App > iOSDownload
GoogleService-Info.plistAdd
GoogleService-Info.plistusing XCode by right clicking on project and selectAdd Files, select your downloaded file and make sureCopy items if neededis checked.
Usage
For detailed usage, refer to the documentation.
Contributing
Please follow these steps to set-up development environment.
You'll also need Apollo CLI to generate files.
$ npm i -g apolloFor the next steps, please follow the guide for the respective platform:
Publishing
Simply use yarn publish to bump the version & release. Once done, push the commit that yarn adds to GitHub:
$ yarn publish
$ git push origin main2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago