Skip to content

Commit

Permalink
merge develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sumukhah committed Mar 8, 2022
2 parents c46b21c + e36d0d8 commit 21c3b07
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 130 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ lib/

# examples
examples/ios/*
react-native-connect-0.0.1.tgz
react-native-phyllo-connect-0.0.1.tgz
*.tgz
.env
.vscode
package-lock.json
example/package-lock.json
example/package-lock.json
example/config.js
32 changes: 32 additions & 0 deletions Issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Facing any issues?

1. **Execution failed for task ':app:processDebugMainManifest'.**\

> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @66b22ec6
If you are facing this error on Android run, modify android/app/src/main/AndroidManifest.xml set `allowBackup` to `True`

```sh
<application
...
android:allowBackup="true"
>
```

<br>
<br>

2. **Execution failed for task ':app:processDebugMainManifest'.**

> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @66b22ec6
If you are facing this error on Android, modify android/gradle.properties and add the following line at the end

```sh
org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED
```

3. **Specs satisfying the PhylloConnect (~> 0.1.21) dependency were found, but they required a higher minimum deployment target**
> [!] CocoaPods could not find compatible versions for pod "PhylloConnect":react-native-phyllo-connect (from ../node_modules/react-native-phyllo-connect) was resolved to X.Y.Z, which depends on PhylloConnect (~> X.Y.Z)
If your issue not listed here, raise an issue in the [issues section](https://github.com/getphyllo/phyllo-connect-reactnative/issues) or report your issue on [#bug-reports](https://discord.com/channels/897097781355888640/949535402845405184) channel of our [Discord server](https://discord.com/channels/897097781355888640/).
58 changes: 36 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Configuring the SDK

In your react-native project directory:
In your React Native project directory:

```sh
npm install react-native-phyllo-connect
Expand All @@ -25,55 +25,69 @@ Then install iOS dependencies using cocoapods:\
cd ios && pod install
```

## React native implementation
## React Native implementation

### Import and create an instace
### Importing from react-native-phyllo-connect

```sh
// import the PhylloConnect to your application
import PhylloConnect from 'react-native-phyllo-connect'

// create an instance of PhylloConnect
const phylloConnect = new PhylloConnect()
```

### Subscribing to events

```sh
// Subscribe to an event by passing a callback
const eventWatcher = phylloConnect.addAnEventListener('<event-type>', callbackFunction)
PhylloConnect.on('<event-type>', callbackFunction)

// Unsubscribe with remove
eventWatcher.remove()
const callbackFunction = (body) => {
// callback body
}
```

here event type can be `onExit`, `onAccountConnected`, `onAccountDisconnected`, `onTokenExpired`.
Event types can be `exit`, `accountConnected`, `accountDisconnected`, or `tokenExpired`.
| Event type | Description | Callback body|
| -----------| ------------| --------- |
| exit | Called when a user exits from phyllo flow| user_id, reason |
| accountConnected | Called when a user connects a platform| user_id, account_id, work_platform_id |
| accountDisconnected | Called when a user disconnects a platform| user_id, account_id, work_platform_id |
| tokenExpired | Called when a user token expires| user_id |

Creating a user and token for a user
### Creating a user and token

- [Check this document on creating a user](https://docs.getphyllo.com/docs/api-reference/b3A6MTQwNjEzNzY-create-a-user)
- [Check this document on creating a user token](https://docs.getphyllo.com/docs/api-reference/b3A6MTQwNjEzNzc-create-an-sdk-token)

### Open Phyllo SDK flow

```sh
phylloConnect.initialize({ clientDisplayName, userId, token, platformId, env});
import { PhylloEnvironment } from 'react-native-phyllo-connect'

const config = {
clientDisplayName: clientDisplayName,
token: token,
userId: userId,
environment: PhylloEnvironment.<environmentType>,
workPlatformId: workPlatformId,
}

const phylloConnect = PhylloConnect.initialize(config)
phylloConnect.open()
```
| Arguments | Value | Type |
| ----------------- | ----------------------- | ------------------------------------------ |
| clientDisplayName | Application Name | String |
| userId | User Id | String |
| token | User Token | String |
| platformId | Platform Id | String or Undefined |
| env | Development Environment | "development" or "production" or "sandbox" |
| Arguments | Value | Type |
| ----------------- | ---------------------- | ------------------------------------------------------------------------------------------ |
| clientDisplayName | Client Display Name | String |
| token | User Token | String |
| userId | User Id | String |
| environment | Environment | PhylloEnvironment.sandbox or PhylloEnvironment.development or PhylloEnvironment.production |
| workPlatformId | Platform Id (optional) | String or Null |
### Examples
<b>Try our [sample app](https://github.com/getphyllo/phyllo-connect-reactnative/tree/release-v0.0.1/example)
<b>Try our [sample app](https://github.com/getphyllo/phyllo-connect-reactnative/tree/main/example)
</b>
Facing any issue? Feel free to raise an issue in the [issues section](<(https://github.com/getphyllo/phyllo-connect-reactnative/issues)>)
Facing any issue? We have listed solutions for some comman issues [here](https://github.com/getphyllo/phyllo-connect-reactnative/blob/develop/Issues.md), If it doesn't help you, feel free to raise an issue in the [issues section](https://github.com/getphyllo/phyllo-connect-reactnative/issues) or report your issue on [#bug-reports](https://discord.com/channels/897097781355888640/949535402845405184) channel of our [Discord server](https://discord.com/channels/897097781355888640/).
## Author
Expand Down
Binary file removed android/app
Binary file not shown.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+'
implementation "com.getphyllo:phyllo-connect:0.1.13"
implementation "com.getphyllo:phyllo-connect:0.1.14"

implementation "com.squareup.okhttp3:okhttp-urlconnection:4.9.0"
implementation "com.squareup.okhttp3:logging-interceptor:4.9.0"
Expand Down
3 changes: 0 additions & 3 deletions example/.env

This file was deleted.

4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ npm install
cd ios && pod install
```

### 🔑 Add your client ID and secrets to `example/config.js` file
### 🔑 Add your credentials in `example/src/config.js` file

> Assuming you have a client ID and secret, if not reach out at [email protected]
```
```sh
clientId = 'YOUR-CLIENT-ID'
clientSecret = 'YOUR-SECRET-KEY'
env = 'APPLICATION-ENVIRONMENT'
Expand Down
24 changes: 17 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ PODS:
- glog (0.3.5)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.180)
- phyllo-connect-react-native (0.0.1):
- PhylloConnect (~> 0.1.20)
- React
- PhylloConnect (0.1.21)
- RCT-Folly (2021.06.28.00-v2):
- boost
Expand Down Expand Up @@ -276,6 +273,12 @@ PODS:
- React-jsinspector (0.67.3)
- React-logger (0.67.3):
- glog
- react-native-phyllo-connect (0.0.8):
- PhylloConnect (~> 0.1.21)
- React
- react-native-simple-toast (1.1.3):
- React-Core
- Toast (~> 4.0.0)
- React-perflogger (0.67.3)
- React-RCTActionSheet (0.67.3):
- React-Core/RCTActionSheetHeaders (= 0.67.3)
Expand Down Expand Up @@ -343,6 +346,7 @@ PODS:
- React-perflogger (= 0.67.3)
- RNCAsyncStorage (1.16.1):
- React-Core
- Toast (4.0.0)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
Expand Down Expand Up @@ -375,7 +379,6 @@ DEPENDENCIES:
- FlipperKit/SKIOSNetworkPlugin (= 0.99.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- OpenSSL-Universal (= 1.1.180)
- phyllo-connect-react-native (from `../node_modules/phyllo-connect-react-native`)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
Expand All @@ -390,6 +393,8 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-phyllo-connect (from `../node_modules/react-native-phyllo-connect`)
- react-native-simple-toast (from `../node_modules/react-native-simple-toast`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
Expand Down Expand Up @@ -421,6 +426,7 @@ SPEC REPOS:
- libevent
- OpenSSL-Universal
- PhylloConnect
- Toast
- YogaKit

EXTERNAL SOURCES:
Expand All @@ -434,8 +440,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
phyllo-connect-react-native:
:path: "../node_modules/phyllo-connect-react-native"
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
Expand All @@ -460,6 +464,10 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-phyllo-connect:
:path: "../node_modules/react-native-phyllo-connect"
react-native-simple-toast:
:path: "../node_modules/react-native-simple-toast"
React-perflogger:
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
React-RCTActionSheet:
Expand Down Expand Up @@ -508,7 +516,6 @@ SPEC CHECKSUMS:
glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
phyllo-connect-react-native: 0d2366c5a2d3b92ff38c179ec1ed489ce80af7d4
PhylloConnect: 77394c7b6ba60c18dafdf056327120776f77c212
RCT-Folly: 803a9cfd78114b2ec0f140cfa6fa2a6bafb2d685
RCTRequired: 3c77b683474faf23920fbefc71c4e13af21470c0
Expand All @@ -522,6 +529,8 @@ SPEC CHECKSUMS:
React-jsiexecutor: 15ea57ead631a11fad57634ff69f78e797113a39
React-jsinspector: 1e1e03345cf6d47779e2061d679d0a87d9ae73d8
React-logger: 1e10789cb84f99288479ba5f20822ce43ced6ffe
react-native-phyllo-connect: 415946bb24b7a0249aa9ab4b19540d216891d03e
react-native-simple-toast: b986e6c1befdc211af3df1bae293278a44e32990
React-perflogger: 93d3f142d6d9a46e635f09ba0518027215a41098
React-RCTActionSheet: 87327c3722203cc79cf79d02fb83e7332aeedd18
React-RCTAnimation: 009c87c018d50e0b38692699405ebe631ff4872d
Expand All @@ -535,6 +544,7 @@ SPEC CHECKSUMS:
React-runtimeexecutor: af1946623656f9c5fd64ca6f36f3863516193446
ReactCommon: 650e33cde4fb7d36781cd3143f5276da0abb2f96
RNCAsyncStorage: c0754b486fec6e532d358bfd7337cb45c8d2c897
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
Yoga: 90dcd029e45d8a7c1ff059e8b3c6612ff409061a
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
4 changes: 0 additions & 4 deletions example/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
0264ED890D079BB9A99DCA28 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AFBF5BFF5F2120C4BEF2749 /* libPods-example.a */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
F69336A727D0BA5000EAC317 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = F69336A627D0BA5000EAC317 /* main.jsbundle */; };
FAA6DE282607FC1C0044CA6D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */; };
/* End PBXBuildFile section */

Expand All @@ -22,7 +21,6 @@
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = "<group>"; };
97D2F575C9E1CCB8487D7A83 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
F69336A627D0BA5000EAC317 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
F9197C6B9DA65F8C6AC6D250 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = "<group>"; };
FAA6DE2A2607FC480044CA6D /* example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "example-Bridging-Header.h"; path = "example/example-Bridging-Header.h"; sourceTree = "<group>"; };
Expand All @@ -46,7 +44,6 @@
FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
F69336A627D0BA5000EAC317 /* main.jsbundle */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
FAA6DE2A2607FC480044CA6D /* example-Bridging-Header.h */,
);
Expand Down Expand Up @@ -161,7 +158,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F69336A727D0BA5000EAC317 /* main.jsbundle in Resources */,
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
Expand Down
16 changes: 0 additions & 16 deletions example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,7 @@
* @format
*/

const path = require('path')
const exclusionList = require('metro-config/src/defaults/exclusionList')

const moduleRoot = path.resolve(__dirname, '..')

module.exports = {
watchFolders: [moduleRoot],
resolver: {
extraNodeModules: {
react: path.resolve(__dirname, 'node_modules/react'),
'react-native': path.resolve(__dirname, 'node_modules/react-native'),
},
blockList: exclusionList([
new RegExp(`${moduleRoot}/node_modules/react/.*`),
new RegExp(`${moduleRoot}/node_modules/react-native/.*`),
]),
},
transformer: {
getTransformOptions: async () => ({
transform: {
Expand Down
5 changes: 3 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"axios": "^0.26.0",
"babel-runtime": "^6.26.0",
"base-64": "^1.0.0",
"phyllo-connect-react-native": "0.0.1",
"react": "^17.0.2",
"react-native": "^0.67.1",
"react-native-bouncy-checkbox": "^2.1.10"
"react-native-bouncy-checkbox": "^2.1.10",
"react-native-phyllo-connect": "0.0.8",
"react-native-simple-toast": "^1.1.3"
},
"devDependencies": {
"@babel/core": "^7.16.12",
Expand Down
Loading

0 comments on commit 21c3b07

Please sign in to comment.