Skip to content

Commit

Permalink
Merge pull request #28 from taras-omelchuk/master
Browse files Browse the repository at this point in the history
Dynamics SDK for React Native v12.0
  • Loading branch information
volodymyrtaliar authored Dec 1, 2023
2 parents a464543 + 881dc89 commit 1e136f7
Show file tree
Hide file tree
Showing 379 changed files with 19,504 additions and 10,856 deletions.
Binary file removed BlackBerry Dynamics Software Development Kit.pdf
Binary file not shown.
153 changes: 129 additions & 24 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions SampleApplications/AppKinetics/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
53 changes: 10 additions & 43 deletions SampleApplications/AppKinetics/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,44 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
node_modules/react-native/Libraries/react-native/React.js

; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/HMRLoadingView.js
.*/Libraries/Utilities/LoadingView.js

.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/interface.js
node_modules/react-native/flow/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
exact_by_default=true

format.bracket_spacing=false

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -81,10 +51,7 @@ untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
Expand All @@ -96,4 +63,4 @@ untyped-import
untyped-type-import

[version]
^0.98.0
^0.182.0
1 change: 0 additions & 1 deletion SampleApplications/AppKinetics/.gitattributes

This file was deleted.

15 changes: 10 additions & 5 deletions SampleApplications/AppKinetics/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
ios/.xcode.env.local

# Android/IntelliJ
#
Expand All @@ -29,6 +29,8 @@ build/
.gradle
local.properties
*.iml
*.hprof
.cxx/

# node.js
#
Expand All @@ -40,6 +42,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand All @@ -48,12 +51,14 @@ buck-out/
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# CocoaPods
# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
1 change: 1 addition & 0 deletions SampleApplications/AppKinetics/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
3 changes: 2 additions & 1 deletion SampleApplications/AppKinetics/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
1 change: 1 addition & 0 deletions SampleApplications/AppKinetics/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.5
6 changes: 6 additions & 0 deletions SampleApplications/AppKinetics/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
85 changes: 59 additions & 26 deletions SampleApplications/AppKinetics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,23 @@ Open the sample app directory in Terminal window:
Install dependencies:
`$ yarn`

NOTE: AppKinetics sample is based on `0.66.4` version of React Native. There is a possibility to upgrade to `0.67.x` or `0.68.x` versions (`0.67.0` - `0.67.4`, `0.68.0` - `0.68.2`) by running one of following commands:
`$ react-native upgrade 0.6x.x`
> NOTE: AppKinetics sample is based on `0.70.0` version of React Native. There is a possibility to upgrade to `0.70.x`, `0.71.x`, `0.72.x` versions (`0.70.1` - `0.70.10`, `0.71.0` - `0.71.13`, `0.72.0` - `0.72.4`) by running one of following commands:
`$ npx react-native upgrade 0.70.x`
for example:
`$ react-native upgrade 0.67.4`
`$ npx react-native upgrade 0.70.10`
or
`$ react-native upgrade 0.68.2`
`$ npx react-native upgrade 0.71.13`
or
`$ npx react-native upgrade 0.72.4`

Generate ios and android directories:
`$ react-native eject`
`$ npx react-native eject`

Generate ios and android directories:
`$ react-native eject`
`$ npx react-native eject`

> There is a known issue with loading Metro server on `0.72.0` and `0.72.1` versions when the error message is displayed during app load in Metro server: "Cannot read properties of undefined (reading 'addHelper')". The issue can be fixed by adding the following devDependency to the project:
`$ yarn add @babel/traverse@7.22.8 --dev`

## Install Dynamics modules
#### Prerequisites
Expand All @@ -76,17 +81,23 @@ It is suggested to use **`com.blackberry.bbd.example.cdv.appkinetics.server`** h
$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-AppKinetics

##### iOS
Different `ruby` versions might be install on the machine. Especially it is related to React Native v`0.70.x` projects.
Depending on your Mac configuration following error can occur when running `pod install` command:
```
Traceback (most recent call last):
4: from /Users/vtaliar/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `<main>'
3: from /Users/vtaliar/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `eval'
2: from /Users/vtaliar/.rvm/gems/ruby-2.7.5/bin/pod:23:in `<main>'
1: from /Users/vtaliar/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:296:in `activate_bin_path'
/Users/vtaliar/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:277:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
```
More details can be found [here](https://medium.com/@pk60905/bundle-install-and-bundle-update-80f3d6f52214).

`$ bundle install` - needed on some `0.70.x` versions to fix the issue above
`$ cd ios`
`$ pod install`
`$ cd ..`

#### How to run application
##### iOS
`$ react-native run-ios`

##### Android
`$ react-native run-android`

#### How to secure FileSystem
$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-FileSystem

Expand All @@ -101,10 +112,10 @@ It is suggested to use **`com.blackberry.bbd.example.cdv.appkinetics.server`** h

#### How to run application
##### iOS
`$ react-native run-ios`
`$ npx react-native run-ios`

##### Android
`$ react-native run-android`
`$ npx react-native run-android`

## Prepare files that will be sent to other app
In order to send files to other Dynamics applications files need to be stored in appropriate location.
Expand Down Expand Up @@ -136,29 +147,51 @@ Native Dynamics AppKinetics sample is a service provider of **`transfer-file`**
4. Install and activate

## Examples of usage
##### 0.66.4
##### 0.70.0
`$ cd <path>/SampleApplications/AppKinetics`
`$ yarn`
`$ react-native eject`
`$ git init`
`$ npx react-native eject`
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-Base`
`$ yarn set-bundle-id`
It is suggested to use **`com.blackberry.bbd.example.cdv.appkinetics.client`** here. An app with this ID is already configured on UEM as a service provider of **`transfer-file`** service, so it can both send and receive files.
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-AppKinetics`
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-FileSystem`
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-Networking`
For iOS:
For iOS:
`$ bundle install`
`$ cd ios`
`$ pod install`
`$ cd ..`
`$ npx react-native run-ios`
For Android:
`$ npx react-native run-android`
##### 0.70.10
`$ cd <path>/SampleApplications/AppKinetics`
`$ yarn`
`$ git init`
`$ npx react-native upgrade 0.70.10`
`$ npx react-native eject`
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-Base`
`$ yarn set-bundle-id`
It is suggested to use **`com.blackberry.bbd.example.cdv.appkinetics.client`** here. An app with this ID is already configured on UEM as a service provider of **`transfer-file`** service, so it can both send and receive files.
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-AppKinetics`
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-FileSystem`
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-Networking`
For iOS:
`$ cd ios`
`$ pod install`
`$ cd ..`
`$ react-native run-ios`
`$ npx react-native run-ios`
For Android:
`$ react-native run-android`
##### 0.68.2
`$ npx react-native run-android`
##### 0.72.0
`$ cd <path>/SampleApplications/AppKinetics`
`$ yarn`
`$ cd .. ; git init ; cd AppKinetics`
`$ react-native upgrade 0.68.2`
`$ react-native eject`
`$ yarn add @babel/traverse@7.22.8 --dev` - OPTIONAL: needed on `0.72.0`, `0.72.1` versions to fix the error mentioned above in Metro server
`$ git init`
`$ npx react-native upgrade 0.72.0`
`$ npx react-native eject`
`$ yarn add <path>/modules/BlackBerry-Dynamics-for-React-Native-Base`
`$ yarn set-bundle-id`
It is suggested to use **`com.blackberry.bbd.example.cdv.appkinetics.client`** here. An app with this ID is already configured on UEM as a service provider of **`transfer-file`** service, so it can both send and receive files.
Expand All @@ -169,6 +202,6 @@ For iOS:
`$ cd ios`
`$ pod install`
`$ cd ..`
`$ react-native run-ios`
`$ npx react-native run-ios`
For Android:
`$ react-native run-android`
`$ npx react-native run-android`
13 changes: 6 additions & 7 deletions SampleApplications/AppKinetics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-native-fontawesome": "^0.2.6",
"react": "17.0.2",
"react-native": "0.66.4",
"react": "18.1.0",
"react-native": "0.70.0",
"react-native-svg": "^12.1.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2",
"react-native-eject": "^0.1.2",
"react-native-codegen": "^0.0.7"
"metro-react-native-babel-preset": "^0.72.1",
"react-native-eject": "^0.2.0",
"react-test-renderer": "18.1.0"
},
"license": "SEE LICENSE IN LICENSE",
"jest": {
Expand Down
2 changes: 2 additions & 0 deletions SampleApplications/BasicNetworking/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
4 changes: 4 additions & 0 deletions SampleApplications/BasicNetworking/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
Loading

0 comments on commit 1e136f7

Please sign in to comment.