# Yajny React Native App

## Set up

- git clone {project_url}
- cd {project}
- npm install
- cd ios (for IOS)
- pod install

## Project structure information

### api keys and config data

- api keys includes oneSignal , google client id , renew token for mobile devices | check **.env.development || .env.staging || .env.production**

### cashback string / business logic / utils

- check "./src/helpers"

### custom native component used : FToast

- react native : "./src/components/FToast.js"

- android :

1. "./android/app/src/main/java/com/arabyads.yajny/FToastModule.java"
2. "./android/app/src/main/java/com/arabyads.yajny/FToastPackage.java"

- ios:

"./ios/Yajny.xcodeproj"

### localization / rtl support

- project has react-native I18nManager api support | check "./src/translations" folder and "./src/Screens/Language"

### common styles and icon

- "./src/common/commonStyle.js" , "./src/common/icons.js"
- for "fontFamily" fonts are added manually in respective native folders , to add more fonts or icon add fontFile in "./assets/fonts" and run npm link.(npm link doesn't work always( auto linking with react-native.config ), if fontfamily is not being reconsigned in project please add manually and unlink assets )

### deeplinking

- handled on "yajny:" and "https:" schema

- android:
- update manifest file to change anything in url or schema

- ios:
- update info.plist file

### oneSignal

- ~~push notifications are handled in "./src/index" file
  notification actions are handled based on data object
  ex:~~

- ~~for member notification~~

```javascript
data = {
  isMemberMessage: true,
  tabName: Dashboard || Activities || Withdrawal,
  action: 'cashback/ ' || 'bonus/' || 'referral/' || 'clickHistory',
};
```

- ~~for non member notification~~

```javascript
data = {
  isMemberMessage: false,
  storeName: 'Amazon',
  store_id: 28369,
};
```

- ~~if notification contains url then app will handle it with linking api | check "./src/index.js" "\_handleOpenURL" func.~~

- **We use oneSignal now to get push token and send it to CleverTap which we use to send notification from.**
- **We also send the push token to Adjust.**

## steps for bundle id change

### android

- in changing package name in java files make sure to update it in Ftoast module.

### ios

- change bundle id with Yajny target selected
- have to generate all certificates and api keys

### sdk configuration changes

- these packages requires an update at console if you change bundle/package id

1. "react-native-onesignal"
2. "react-native-fbsdk-next"
3. "@react-native-community/google-signin"
4. "@invertase/react-native-apple-authentication"
5. "@react-native-firebase/auth"

## dependencies

- all required interdependencies

1. navigation

- react-native-pagination
- react-native-reanimated
- react-native-tab-view
- react-native-gesture-handler

2. react-native-swiper

- @react-native-community/viewpager (for android)

- removed lib from project

- lodash.memoize (commented code can be found in "./src/translations)
- redux-action (commented code can be found in "./src/redux/actions/general.js")

## deployment

Note : Change root component for respective platform | check './src/index.js'
