Skip to content

Commit 48c2b01

Browse files
mwclemyClement Mwimo
andauthored
Fix example app and upgrade packages (#100)
* fixed android example * upgrade ios app to react-native 0.75.3 * updated project.pbxproj * fixed ios * @mxenabled/widget-post-message-definitions * fixed the test * bumped up the sdk version --------- Co-authored-by: Clement Mwimo <clement.mwimo@mx.com>
1 parent 558e7bb commit 48c2b01

58 files changed

Lines changed: 18965 additions & 35656 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

babel.config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
module.exports = function(api) {
2-
api.cache(true);
3-
return {
4-
presets: [
5-
"module:metro-react-native-babel-preset",
6-
"@babel/preset-typescript",
7-
]
8-
};
9-
};
1+
// eslint-disable-next-line no-undef
2+
module.exports = {
3+
presets: ["module:@react-native/babel-preset"],
4+
}

docs/widget_callback_props.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,61 @@ import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"
436436
437437
</details>
438438
439+
---
440+
### Back to search (`mx/connect/backToSearch`)
441+
442+
- Widget callback prop name: `onBackToSearch`
443+
- Payload fields:
444+
- `user_guid` (`string`)
445+
- `session_guid` (`string`)
446+
- `context` (optional) (`string`)
447+
448+
<details>
449+
<summary>Click here to view a sample usage of <code>onBackToSearch</code>.</summary>
450+
451+
```jsx
452+
import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"
453+
454+
<ConnectWidget
455+
url="https://widgets.moneydesktop.com/md/connect/..."
456+
457+
onBackToSearch={(payload) => {
458+
console.log(`User guid: ${payload.user_guid}`)
459+
console.log(`Session guid: ${payload.session_guid}`)
460+
console.log(`Context: ${payload.context}`)
461+
}
462+
/>
463+
```
464+
465+
</details>
466+
467+
---
468+
### Invalid data (`mx/connect/invalidData`)
469+
470+
- Widget callback prop name: `onInvalidData`
471+
- Payload fields:
472+
- `user_guid` (`string`)
473+
- `session_guid` (`string`)
474+
- `member_guid` (`string`)
475+
- `code` (`number`)
476+
477+
<details>
478+
<summary>Click here to view a sample usage of <code>onInvalidData</code>.</summary>
479+
480+
```jsx
481+
import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"
482+
483+
<ConnectWidget
484+
url="https://widgets.moneydesktop.com/md/connect/..."
485+
486+
onInvalidData={(payload) => {
487+
console.log(`User guid: ${payload.user_guid}`)
488+
console.log(`Session guid: ${payload.session_guid}`)
489+
console.log(`Member guid: ${payload.member_guid}`)
490+
console.log(`Code: ${payload.code}`)
491+
}
492+
/>
493+
```
494+
495+
</details>
496+

example/.buckconfig

Lines changed: 0 additions & 6 deletions
This file was deleted.

example/.eslintrc.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
4-
};
3+
extends: "@react-native",
4+
rules: {
5+
semi: 0,
6+
singleQuote: false,
7+
},
8+
}

example/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { useState, FC, PropsWithChildren } from "react"
2-
import { SafeAreaView, Text, View, StyleSheet, StyleProp, ViewStyle } from "react-native"
1+
import React, { FC, PropsWithChildren } from "react"
2+
import { SafeAreaView, Text, View, StyleSheet, StyleProp, ViewStyle, Platform } from "react-native"
33
import { NativeRouter, Routes, Route, Link } from "react-router-native"
44

55
import {
@@ -11,7 +11,8 @@ import {
1111
TransactionsWidget,
1212
} from "@mxenabled/react-native-widget-sdk"
1313

14-
const proxy = "http://localhost:8089/user/widget_urls"
14+
const baseUrl = Platform.OS === "android" ? "http://10.0.2.2:8089" : "http://localhost:8089"
15+
const proxy = `${baseUrl}/user/widget_urls`
1516
const styles = StyleSheet.create({
1617
page: {
1718
backgroundColor: "#ffffff",
@@ -72,7 +73,6 @@ const Home = () => (
7273

7374
const Page: FC<PropsWithChildren<{ style?: StyleProp<ViewStyle>; goBack?: boolean }>> = ({
7475
children,
75-
style,
7676
goBack = true,
7777
}) => (
7878
<SafeAreaView style={styles.page}>
@@ -108,10 +108,10 @@ const Connect = () => {
108108
onInvalidMessageError={(url, _error) => {
109109
console.log(`Got an unknown message: ${url}`)
110110
}}
111-
onLoad={(payload) => {
111+
onLoad={(_payload) => {
112112
console.log("Widget is loading")
113113
}}
114-
onLoaded={(payload) => {
114+
onLoaded={(_payload) => {
115115
console.log("Widget has loaded")
116116
}}
117117
onStepChange={(payload) => {

example/Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '2.7.5'
4+
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'

example/Gemfile.lock

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,49 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.5)
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
57
rexml
6-
activesupport (6.1.7)
8+
activesupport (7.1.4)
9+
base64
10+
bigdecimal
711
concurrent-ruby (~> 1.0, >= 1.0.2)
12+
connection_pool (>= 2.2.5)
13+
drb
814
i18n (>= 1.6, < 2)
915
minitest (>= 5.1)
16+
mutex_m
1017
tzinfo (~> 2.0)
11-
zeitwerk (~> 2.3)
12-
addressable (2.8.1)
13-
public_suffix (>= 2.0.2, < 6.0)
18+
addressable (2.8.7)
19+
public_suffix (>= 2.0.2, < 7.0)
1420
algoliasearch (1.27.5)
1521
httpclient (~> 2.8, >= 2.8.3)
1622
json (>= 1.5.1)
1723
atomos (0.1.3)
24+
base64 (0.2.0)
25+
bigdecimal (3.1.8)
1826
claide (1.1.0)
19-
cocoapods (1.11.3)
27+
cocoapods (1.15.2)
2028
addressable (~> 2.8)
2129
claide (>= 1.0.2, < 2.0)
22-
cocoapods-core (= 1.11.3)
30+
cocoapods-core (= 1.15.2)
2331
cocoapods-deintegrate (>= 1.0.3, < 2.0)
24-
cocoapods-downloader (>= 1.4.0, < 2.0)
32+
cocoapods-downloader (>= 2.1, < 3.0)
2533
cocoapods-plugins (>= 1.0.0, < 2.0)
2634
cocoapods-search (>= 1.0.0, < 2.0)
27-
cocoapods-trunk (>= 1.4.0, < 2.0)
35+
cocoapods-trunk (>= 1.6.0, < 2.0)
2836
cocoapods-try (>= 1.1.0, < 2.0)
2937
colored2 (~> 3.1)
3038
escape (~> 0.0.4)
3139
fourflusher (>= 2.3.0, < 3.0)
3240
gh_inspector (~> 1.0)
3341
molinillo (~> 0.8.0)
3442
nap (~> 1.0)
35-
ruby-macho (>= 1.0, < 3.0)
36-
xcodeproj (>= 1.21.0, < 2.0)
37-
cocoapods-core (1.11.3)
38-
activesupport (>= 5.0, < 7)
43+
ruby-macho (>= 2.3.0, < 3.0)
44+
xcodeproj (>= 1.23.0, < 2.0)
45+
cocoapods-core (1.15.2)
46+
activesupport (>= 5.0, < 8)
3947
addressable (~> 2.8)
4048
algoliasearch (~> 1.0)
4149
concurrent-ruby (~> 1.1)
@@ -45,7 +53,7 @@ GEM
4553
public_suffix (~> 4.0)
4654
typhoeus (~> 1.0)
4755
cocoapods-deintegrate (1.0.5)
48-
cocoapods-downloader (1.6.3)
56+
cocoapods-downloader (2.1)
4957
cocoapods-plugins (1.0.0)
5058
nap
5159
cocoapods-search (1.0.1)
@@ -54,44 +62,52 @@ GEM
5462
netrc (~> 0.11)
5563
cocoapods-try (1.2.0)
5664
colored2 (3.1.2)
57-
concurrent-ruby (1.1.10)
65+
concurrent-ruby (1.3.4)
66+
connection_pool (2.4.1)
67+
drb (2.2.1)
5868
escape (0.0.4)
59-
ethon (0.15.0)
69+
ethon (0.16.0)
6070
ffi (>= 1.15.0)
61-
ffi (1.15.5)
71+
ffi (1.17.0)
72+
ffi (1.17.0-arm64-darwin)
73+
ffi (1.17.0-x86_64-darwin)
6274
fourflusher (2.3.1)
6375
fuzzy_match (2.0.4)
6476
gh_inspector (1.1.3)
6577
httpclient (2.8.3)
66-
i18n (1.12.0)
78+
i18n (1.14.6)
6779
concurrent-ruby (~> 1.0)
68-
json (2.6.2)
69-
minitest (5.16.3)
80+
json (2.7.2)
81+
minitest (5.25.1)
7082
molinillo (0.8.0)
83+
mutex_m (0.2.0)
7184
nanaimo (0.3.0)
7285
nap (1.1.0)
7386
netrc (0.11.0)
87+
nkf (0.2.0)
7488
public_suffix (4.0.7)
75-
rexml (3.2.5)
89+
rexml (3.3.7)
7690
ruby-macho (2.5.1)
77-
typhoeus (1.4.0)
91+
typhoeus (1.4.1)
7892
ethon (>= 0.9.0)
79-
tzinfo (2.0.5)
93+
tzinfo (2.0.6)
8094
concurrent-ruby (~> 1.0)
81-
xcodeproj (1.22.0)
95+
xcodeproj (1.25.0)
8296
CFPropertyList (>= 2.3.3, < 4.0)
8397
atomos (~> 0.1.3)
8498
claide (>= 1.0.2, < 2.0)
8599
colored2 (~> 3.1)
86100
nanaimo (~> 0.3.0)
87-
rexml (~> 3.2.4)
88-
zeitwerk (2.6.1)
101+
rexml (>= 3.3.2, < 4.0)
89102

90103
PLATFORMS
104+
arm64-darwin-23
105+
ruby
91106
x86_64-darwin-21
92107

93108
DEPENDENCIES
94-
cocoapods (~> 1.11, >= 1.11.2)
109+
activesupport (>= 6.1.7.5, != 7.1.0)
110+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
95111

96112
RUBY VERSION
97113
ruby 2.7.5p203

example/__tests__/App-test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* @format
33
*/
44

5-
import 'react-native';
6-
import React from 'react';
7-
import App from '../App';
5+
import "react-native"
6+
import React from "react"
7+
import App from "../App"
88

99
// Note: test renderer must be required after react-native.
10-
import renderer from 'react-test-renderer';
10+
import renderer from "react-test-renderer"
1111

12-
it('renders correctly', () => {
13-
renderer.create(<App />);
14-
});
12+
it("renders correctly", () => {
13+
renderer.create(<App />)
14+
})

example/_node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/_ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)