Skip to content

Commit 87720e4

Browse files
committed
feat: Initial react native release
1 parent 0a71ab8 commit 87720e4

Some content is hidden

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

56 files changed

+18909
-1
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf

.gitignore

+78-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,78 @@
1-
.DS_STORE
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
12+
# Xcode
13+
#
14+
build/
15+
*.pbxuser
16+
!default.pbxuser
17+
*.mode1v3
18+
!default.mode1v3
19+
*.mode2v3
20+
!default.mode2v3
21+
*.perspectivev3
22+
!default.perspectivev3
23+
xcuserdata
24+
*.xccheckout
25+
*.moved-aside
26+
DerivedData
27+
*.hmap
28+
*.ipa
29+
*.xcuserstate
30+
project.xcworkspace
31+
32+
# Android/IJ
33+
#
34+
.classpath
35+
.cxx
36+
.gradle
37+
.idea
38+
.project
39+
.settings
40+
local.properties
41+
android.iml
42+
43+
# Cocoapods
44+
#
45+
example/ios/Pods
46+
47+
# Ruby
48+
example/vendor/
49+
50+
# node.js
51+
#
52+
node_modules/
53+
npm-debug.log
54+
yarn-debug.log
55+
yarn-error.log
56+
57+
# BUCK
58+
buck-out/
59+
\.buckd/
60+
android/app/libs
61+
android/keystores/debug.keystore
62+
63+
# Yarn
64+
.yarn/*
65+
!.yarn/patches
66+
!.yarn/plugins
67+
!.yarn/releases
68+
!.yarn/sdks
69+
!.yarn/versions
70+
71+
# Expo
72+
.expo/
73+
74+
# Turborepo
75+
.turbo/
76+
77+
# generated by bob
78+
lib/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18

.tool-versions

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodejs 22.1.0
2+
ruby 3.0.2

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

+541
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

+28
Large diffs are not rendered by default.

.yarn/releases/yarn-3.6.1.cjs

+874
Large diffs are not rendered by default.

.yarnrc.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
3+
4+
plugins:
5+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6+
spec: "@yarnpkg/plugin-interactive-tools"
7+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8+
spec: "@yarnpkg/plugin-workspace-tools"
9+
10+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright (c) 2024 ContextSDK
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# react-native-context-sdk
2+
3+
ContextSDK for React Native
4+
5+
## Supported Platforms
6+
7+
- iOS - 14.0 and higher
8+
- Android - Coming Soon
9+
10+
## Installation
11+
12+
```sh
13+
npm install react-native-context-sdk
14+
```
15+
16+
## Usage
17+
18+
On your first screen, or somewhere that is always ran at app start setup ContextSDK.
19+
20+
```js
21+
import { setup } from 'react-native-context-sdk';
22+
23+
// ...
24+
25+
const licenseValid = await setup("YOUR_LICENSE_KEY_HERE");
26+
```
27+
28+
Optionally, you can log specific events to get a better understanding of how the real world context influences your app.
29+
30+
```js
31+
import {
32+
trackEvent,
33+
trackPageView,
34+
trackUserAction,
35+
} from 'react-native-context-sdk';
36+
37+
/*
38+
Use this to track users navigating through different screen in your app.
39+
It allow us to provide you insights into which screen is most commonly used in which real world context.
40+
*/
41+
trackPageView("page_identifier");
42+
43+
/*
44+
Use this to track certain user actions, like when a user enabled a certain feature, when a user tapped a button, when the user created an account, or when the user shared something.
45+
This allows us to provide you insights into which user actions are most commonly done in which real world context.
46+
*/
47+
trackUserAction("user_tapped_share_button");
48+
49+
/*
50+
Use this to track certain events in your app. This can be used generically to track any type of event. For example, you can add this to your existing analytics code to log all your existing events into ContextSDK.
51+
This allows us to provide you insights into which events are most commonly triggered in which real world context.
52+
*/
53+
trackEvent("custom_event");
54+
```
55+
56+
## License
57+
58+
MIT

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['module:@react-native/babel-preset'],
3+
};

example/.bundle/config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

example/.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

example/Gemfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

example/README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
2+
3+
# Getting Started
4+
5+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
6+
7+
## Step 1: Start the Metro Server
8+
9+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
10+
11+
To start Metro, run the following command from the _root_ of your React Native project:
12+
13+
```bash
14+
# using npm
15+
npm start
16+
17+
# OR using Yarn
18+
yarn start
19+
```
20+
21+
## Step 2: Start your Application
22+
23+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _iOS_ app:
24+
25+
### For iOS
26+
27+
```bash
28+
# using npm
29+
npm run ios
30+
31+
# OR using Yarn
32+
yarn ios
33+
```
34+
35+
If everything is set up _correctly_, you should see your new app running in your _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
36+
37+
This is one way to run your app — you can also run it directly from within Xcode.
38+
39+
## Step 3: Modifying your App
40+
41+
Now that you have successfully run the app, let's modify it.
42+
43+
1. Open `App.tsx` in your text editor of choice and edit some lines.
44+
2. For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
45+
46+
## Congratulations! :tada:
47+
48+
You've successfully run and modified your React Native App. :partying_face:
49+
50+
### Now what?
51+
52+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
53+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
54+
55+
# Troubleshooting
56+
57+
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
58+
59+
# Learn More
60+
61+
To learn more about React Native, take a look at the following resources:
62+
63+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
64+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
65+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
66+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
67+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

example/app.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "ContextSDKExample",
3+
"displayName": "ContextSDKExample"
4+
}

example/babel.config.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const path = require('path');
2+
const pak = require('../package.json');
3+
4+
module.exports = {
5+
presets: ['module:@react-native/babel-preset'],
6+
plugins: [
7+
[
8+
'module-resolver',
9+
{
10+
extensions: ['.tsx', '.ts', '.js', '.json'],
11+
alias: {
12+
[pak.name]: path.join(__dirname, '..', pak.source),
13+
},
14+
},
15+
],
16+
],
17+
};

example/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { AppRegistry } from 'react-native';
2+
import App from './src/App';
3+
import { name as appName } from './app.json';
4+
5+
AppRegistry.registerComponent(appName, () => App);

example/ios/.xcode.env

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This `.xcode.env` file is versioned and is used to source the environment
2+
# used when running script phases inside Xcode.
3+
# To customize your local environment, you can create an `.xcode.env.local`
4+
# file that is not versioned.
5+
6+
# NODE_BINARY variable contains the PATH to the node executable.
7+
#
8+
# Customize the NODE_BINARY variable here.
9+
# For example, to use nvm with brew, add the following line
10+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
11+
export NODE_BINARY=$(command -v node)

example/ios/.xcode.env.local

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export NODE_BINARY=/Users/reinhardhafenscher/.asdf/shims/node
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//

0 commit comments

Comments
 (0)