├── sample
├── app.json
├── ios
│ ├── main.jsbundle.meta
│ ├── sample_menu
│ │ ├── Augment.dat
│ │ ├── Images.xcassets
│ │ │ ├── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.h
│ │ ├── main.m
│ │ ├── AppDelegate.m
│ │ ├── Info.plist
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.xib
│ │ └── Augment.xml
│ ├── sample_menu-Bridging-Header.h
│ ├── EmptyFile.swift
│ ├── sample_menu.xcworkspace
│ │ ├── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── contents.xcworkspacedata
│ ├── Podfile
│ ├── sample_menuTests
│ │ ├── Info.plist
│ │ └── sample_menuTests.m
│ ├── Podfile.lock
│ └── sample_menu.xcodeproj
│ │ └── xcshareddata
│ │ └── xcschemes
│ │ ├── sample_menu-tvOS.xcscheme
│ │ └── sample_menu.xcscheme
├── android
│ ├── app
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ ├── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ │ │ └── node_modules_reactnavigation_src_views_assets_backiconmask.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ │ └── drawable-xxxhdpi
│ │ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ │ ├── assets
│ │ │ │ ├── Augment.dat
│ │ │ │ ├── index.android.bundle.meta
│ │ │ │ └── Augment.xml
│ │ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── sample_menu
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── MainApplication.java
│ │ │ │ └── AndroidManifest.xml
│ │ ├── BUCK
│ │ ├── proguard-rules.pro
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── keystores
│ │ ├── debug.keystore.properties
│ │ └── BUCK
│ ├── settings.gradle
│ ├── gradle.properties
│ ├── build.gradle
│ ├── gradlew.bat
│ └── gradlew
├── src
│ ├── RootStack.js
│ ├── HomeScreen.js
│ └── ARScreen.js
├── index.js
├── package.json
├── README.md
└── .gitignore
├── .eslintrc.js
├── android
├── app
│ └── debug.keystore
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── gradle.properties
├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── augment
│ │ │ └── reactplugin
│ │ │ ├── RNAugmentPlayerProductKeys.java
│ │ │ ├── RNAugmentPlayerEvent.java
│ │ │ ├── AugmentReactPackage.java
│ │ │ ├── RNAugmentPlayerSDK.java
│ │ │ ├── RNAugmentPlayerManager.java
│ │ │ └── RNAugmentPlayer.java
│ │ └── AndroidManifest.xml
├── build.gradle
├── .gitignore
├── gradlew.bat
└── gradlew
├── .prettierrc.js
├── src
├── index.js
├── AugmentPlayerSDK.js
└── AugmentPlayer.js
├── .gitignore
├── ios
├── ReactAugment.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ └── stephane.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── xcuserdata
│ │ ├── fxsalazar.xcuserdatad
│ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ └── stephane.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ └── project.pbxproj
├── ReactAugment
│ ├── RNAugmentPlayerManager.h
│ ├── RNAugmentReactConstants.m
│ ├── RNAugmentPlayerSDK.h
│ ├── RNAugmentReactConstants.h
│ ├── RNAugmentPlayer.h
│ ├── RNAugmentPlayerSDK.m
│ ├── RNAugmentPlayerManager.m
│ └── RNAugmentPlayer.m
├── react-native-augment.xcworkspace
│ └── contents.xcworkspacedata
└── Podfile
├── README.md
├── package.json
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
└── CONTRIBUTING.md
/sample/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sample_menu",
3 | "displayName": "sample_menu"
4 | }
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: '@react-native-community',
4 | };
5 |
--------------------------------------------------------------------------------
/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/android/app/debug.keystore
--------------------------------------------------------------------------------
/sample/ios/main.jsbundle.meta:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/ios/main.jsbundle.meta
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | sample_menu
3 |
4 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/Augment.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/ios/sample_menu/Augment.dat
--------------------------------------------------------------------------------
/sample/ios/sample_menu/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | bracketSpacing: false,
3 | jsxBracketSameLine: true,
4 | singleQuote: true,
5 | trailingComma: 'all',
6 | };
7 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/assets/Augment.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/assets/Augment.dat
--------------------------------------------------------------------------------
/sample/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/sample/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import AugmentPlayerSDK from './AugmentPlayerSDK';
2 | import AugmentPlayer from './AugmentPlayer';
3 |
4 | export { AugmentPlayerSDK, AugmentPlayer };
5 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/assets/index.android.bundle.meta:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/assets/index.android.bundle.meta
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/ios/sample_menu-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 | #import
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | ios/main.*
3 | *.tgz
4 |
5 | # Android/IntelliJ
6 | #
7 | buck-out/
8 | \.buckd/
9 | *.keystore
10 | !debug.keystore
11 |
12 | # CocoaPods
13 | /ios/Pods/
14 |
--------------------------------------------------------------------------------
/sample/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/sample/ios/EmptyFile.swift:
--------------------------------------------------------------------------------
1 | //
2 | // EmptyFile.swift
3 | // sample_menu
4 | //
5 | // Created by Felix Salazar on 29/06/2018.
6 | // Copyright © 2018 Facebook. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
--------------------------------------------------------------------------------
/ios/ReactAugment.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sample/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'sample_menu'
2 | include ':react-native-augment'
3 | project(':react-native-augment').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-augment/android')
4 |
5 | include ':app'
6 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/sample/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backiconmask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backiconmask.png
--------------------------------------------------------------------------------
/sample/android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/sample/android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/ios/ReactAugment.xcodeproj/project.xcworkspace/xcuserdata/stephane.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/augment/react-native-module/develop/ios/ReactAugment.xcodeproj/project.xcworkspace/xcuserdata/stephane.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu May 24 12:01:17 CEST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # This option should only be used with decoupled projects. More details, visit
2 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
3 | # org.gradle.parallel=true
4 |
5 | android.useAndroidX=true
6 | android.enableJetifier=true
7 |
--------------------------------------------------------------------------------
/android/src/main/java/com/augment/reactplugin/RNAugmentPlayerProductKeys.java:
--------------------------------------------------------------------------------
1 | package com.augment.reactplugin;
2 |
3 | public interface RNAugmentPlayerProductKeys {
4 | String IDENTIFIER = "identifier";
5 | String BRAND = "brand";
6 | String NAME = "name";
7 | String EAN = "ean";
8 | }
9 |
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentPlayerManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // ReactAugmentViewManager.h
3 | //
4 | // Copyright © 2017 - Present Augment. All rights reserved.
5 | //
6 |
7 | #import
8 | #import
9 |
10 | @interface RNAugmentPlayerManager : RCTViewManager
11 | @end
12 |
--------------------------------------------------------------------------------
/sample/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '11.0'
3 |
4 | target 'sample_menu' do
5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
6 | use_frameworks!
7 | pod 'AugmentPlayerSDK', '5.1.1'
8 |
9 | end
10 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/src/main/java/com/augment/reactplugin/RNAugmentPlayerEvent.java:
--------------------------------------------------------------------------------
1 | package com.augment.reactplugin;
2 |
3 | public enum RNAugmentPlayerEvent {
4 | onPlayerReady,
5 | onInitializationFailed,
6 | onLoadingProgressDidChange,
7 | onLoadingDidFinish,
8 | onTrackingStatusChanged,
9 | onModelGesture
10 | }
11 |
--------------------------------------------------------------------------------
/ios/react-native-augment.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/ReactAugment.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | @interface AppDelegate : UIResponder
11 |
12 | @property (nonatomic, strong) UIWindow *window;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/sample/src/RootStack.js:
--------------------------------------------------------------------------------
1 | import { StackNavigator } from 'react-navigation'
2 | import HomeScreen from './HomeScreen'
3 | import ARScreen from './ARScreen';
4 |
5 | const RootStack = StackNavigator(
6 | {
7 | Home: {
8 | screen: HomeScreen,
9 | },
10 | ARScreen: {
11 | screen: ARScreen,
12 | }
13 | },
14 | {
15 | initialRouteName: 'Home',
16 | }
17 | );
18 |
19 | export default RootStack;
20 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ios/ReactAugment.xcodeproj/xcuserdata/fxsalazar.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ReactAugment.xcscheme
8 |
9 | orderHint
10 | 38
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ios/ReactAugment.xcodeproj/xcuserdata/stephane.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ReactAugment.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/java/com/sample_menu/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.sample_menu;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "sample_menu";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://badge.fury.io/js/react-native-augment)
2 | # Augment React-Native module
3 |
4 | ## How to use the module
5 |
6 | To install and use this module, please refer to the official [Augment developers documentation](https://developers.augment.com/react-native-sdk)
7 |
8 | ## iOS
9 | Version compatibility:
10 |
11 | | Xcode | SDK |
12 | |-------|----------|
13 | | 10.1 | <= 4.0.x |
14 | | 10.2 | >= 5.x |
15 | | 10.3 | >= 5.x |
16 |
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentReactConstants.m:
--------------------------------------------------------------------------------
1 | //
2 | // AugmentReactConstants.h
3 | // ReactAugment
4 | //
5 | // Created by Stephane Garagnani on 06/09/2018.
6 | // Copyright © 2018 Augment. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | // Credentials dictionary keys
12 |
13 | NSString* const kRNAppID = @"id";
14 | NSString* const kRNAppKey = @"key";
15 |
16 | // Product dictionary keys
17 |
18 | NSString* const kRNProductIdentifierKey = @"identifier";
19 | NSString* const kRNProductBrandKey = @"brand";
20 | NSString* const kRNProductNameKey = @"name";
21 | NSString* const kRNProductEANKey = @"ean";
22 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentPlayerSDK.h:
--------------------------------------------------------------------------------
1 | //
2 | // ReactAugmentManager.h
3 | //
4 | // Copyright © 2017 - Present Augment. All rights reserved.
5 | //
6 |
7 | #import
8 | #import
9 | #import
10 | #import
11 | #import
12 |
13 | @interface RNAugmentPlayerSDK : RCTEventEmitter
14 | @property (class, readonly) AGTAugmentSDK* augmentSDK;
15 |
16 | - (void) init:(NSDictionary*) data;
17 | - (void) isARKitAvailable:(RCTResponseSenderBlock) callback;
18 | - (void) checkIfModelDoesExistForUserProduct: (NSDictionary*) product resolver: (RCTPromiseResolveBlock) resolver rejecter:(RCTPromiseRejectBlock) rejecter;
19 | @end
20 |
--------------------------------------------------------------------------------
/sample/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { AppRegistry } from 'react-native';
3 | import { AugmentPlayerSDK } from 'react-native-augment';
4 | import RootStack from './src/RootStack';
5 |
6 | // Demo credentials, please replace with yours
7 | AugmentPlayerSDK.init({
8 | id: "357fee36746668573ceb2f5957c4869ee1a62a112639bac9b0fae43c7c431692",
9 | key: "80ae1420e164e0440d5329067bcdd953e9fa6c63b75c001c06d169a4f11268c5"
10 | });
11 |
12 | AugmentPlayerSDK.isARKitAvailable().then( (isAvailable) => {
13 | console.log('isARKitAvailable=' + isAvailable);
14 | })
15 |
16 | export default class App extends Component {
17 | render() {
18 | return ;
19 | }
20 | }
21 |
22 | AppRegistry.registerComponent('sample_menu', () => App);
23 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentReactConstants.h:
--------------------------------------------------------------------------------
1 | //
2 | // AugmentReactConstants.h
3 | // ReactAugment
4 | //
5 | // Created by Stephane Garagnani on 06/09/2018.
6 | // Copyright © 2018 Augment. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | // Credentials dictionary keys
12 |
13 | extern NSString* const kRNAppID;
14 | extern NSString* const kRNAppKey;
15 |
16 | // Product dictionary keys
17 |
18 | extern NSString* const kRNProductIdentifierKey;
19 | extern NSString* const kRNProductBrandKey;
20 | extern NSString* const kRNProductNameKey;
21 | extern NSString* const kRNProductEANKey;
22 |
23 | // Model gesture names
24 |
25 | typedef NS_ENUM(NSInteger, RNModelGestureEvent) {
26 | RNModelGestureEventAdded = 1,
27 | RNModelGestureEventTranslated = 2,
28 | RNModelGestureEventRotated = 3
29 | };
30 |
31 |
--------------------------------------------------------------------------------
/sample/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sample_menu",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest"
8 | },
9 | "dependencies": {
10 | "react": "16.8.6",
11 | "react-native": "0.59.6",
12 | "react-native-augment": "3.0.0-beta.4",
13 | "react-native-easy-toast": "^1.1.0",
14 | "react-navigation": "^1.5.11"
15 | },
16 | "devDependencies": {
17 | "babel-core": "^7.0.0-bridge.0",
18 | "babel-jest": "^24.8.0",
19 | "jest": "^24.8.0",
20 | "metro-react-native-babel-preset": "^0.45.0",
21 | "react-test-renderer": "16.8.3"
22 | },
23 | "jest": {
24 | "preset": "react-native"
25 | },
26 | "babel": {
27 | "presets": [
28 | "module:metro-react-native-babel-preset"
29 | ]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/sample/ios/sample_menuTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/sample/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Alamofire (4.8.2)
3 | - AugmentPlayerSDK (5.1.1):
4 | - Alamofire (= 4.8.2)
5 | - JWTDecode
6 | - Moya (= 13.0.1)
7 | - JWTDecode (2.3.0)
8 | - Moya (13.0.1):
9 | - Moya/Core (= 13.0.1)
10 | - Moya/Core (13.0.1):
11 | - Alamofire (~> 4.1)
12 | - Result (~> 4.1)
13 | - Result (4.1.0)
14 |
15 | DEPENDENCIES:
16 | - AugmentPlayerSDK (= 5.1.1)
17 |
18 | SPEC REPOS:
19 | https://github.com/cocoapods/specs.git:
20 | - Alamofire
21 | - AugmentPlayerSDK
22 | - JWTDecode
23 | - Moya
24 | - Result
25 |
26 | SPEC CHECKSUMS:
27 | Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
28 | AugmentPlayerSDK: f4156511589fdb6e9fd7b1911f6e5a61ed7dac80
29 | JWTDecode: fb77675c8049c1a7e9433c7cf448c3ce33ee4ac7
30 | Moya: f4a4b80ff2f8a4ffc208dfb31cd91636622fee6e
31 | Result: bd966fac789cc6c1563440b348ab2598cc24d5c7
32 |
33 | PODFILE CHECKSUM: 76b1bc33710b7b87bafa9b1b045f24e08dffad08
34 |
35 | COCOAPODS: 1.7.5
36 |
--------------------------------------------------------------------------------
/sample/README.md:
--------------------------------------------------------------------------------
1 | # How to use this example
2 |
3 | We assume that you have all the [dependencies](https://facebook.github.io/react-native/docs/getting-started.html) installed for both iOS (remember to install also _CocoaPods_) and Android.
4 |
5 | - run `npm install` to install react dependencies.
6 | - run `pod install` on `ios/` folder to install our SDK on the sample.
7 |
8 | __iOS__ : Now you can open Xcode (using the .`xcworkspace` file) and run the app (only) in a device.
9 |
10 | __Android__: If you had installed [`react-native-cli`](https://facebook.github.io/react-native/docs/getting-started.html#the-react-native-cli) you can just plug your device (remember to enable USB Debugging) and run `react-native run-android` or you can also import `sample/android` in Android Studio and run it.
11 |
12 | If you encounter any problem [let us know](https://github.com/Augment/react-native-module/issues).
13 |
14 | For more information, go to [Augment developers documentation](https://developers.augment.com/react-native-sdk) and run the sample.
15 |
--------------------------------------------------------------------------------
/sample/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useDeprecatedNdk=true
21 |
22 | android.useAndroidX=true
23 | android.enableJetifier=true
24 |
--------------------------------------------------------------------------------
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 |
33 | # node.js
34 | #
35 | node_modules/
36 | npm-debug.log
37 | yarn-error.log
38 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
58 | **/Pods
59 | **/build
60 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-augment",
3 | "version": "3.0.0-beta.4",
4 | "description": "Augment Plugin for the Augment Mobile SDK",
5 | "homepage": "https://developers.augment.com",
6 | "bugs": "https://github.com/Augment/react-native-module/issues",
7 | "author": "Augment (https://developers.augment.com)",
8 | "license": "MIT",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/Augment/react-native-module.git"
12 | },
13 | "main": "src/index.js",
14 | "files": [
15 | "LICENSE",
16 | "README.md",
17 | "CHANGELOG.md",
18 | "src/",
19 | "android/",
20 | "ios/"
21 | ],
22 | "keywords": [
23 | "augment",
24 | "ar",
25 | "augmented reality",
26 | "augment sdk",
27 | "augment.com",
28 | "react-native",
29 | "react",
30 | "android",
31 | "ios"
32 | ],
33 | "nativePackage": true,
34 | "devDependencies": {
35 | "react": "16.9.0",
36 | "react-native": "0.61.2"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Loch Wansbrough
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/android/src/main/java/com/augment/reactplugin/AugmentReactPackage.java:
--------------------------------------------------------------------------------
1 | package com.augment.reactplugin;
2 |
3 | import com.facebook.react.ReactPackage;
4 | import com.facebook.react.bridge.NativeModule;
5 | import com.facebook.react.bridge.ReactApplicationContext;
6 | import com.facebook.react.uimanager.ViewManager;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | import javax.annotation.Nonnull;
12 |
13 | public class AugmentReactPackage implements ReactPackage {
14 |
15 | private RNAugmentPlayerManager rnAugmentPlayerManager = new RNAugmentPlayerManager();
16 |
17 | @Nonnull
18 | @Override
19 | public List createNativeModules(@Nonnull final ReactApplicationContext reactContext) {
20 | return new ArrayList() {{
21 | add(new RNAugmentPlayerSDK(reactContext));
22 | add(rnAugmentPlayerManager);
23 | }};
24 | }
25 |
26 | @Nonnull
27 | @Override
28 | public List createViewManagers(@Nonnull ReactApplicationContext reactContext) {
29 | return new ArrayList() {{
30 | add(rnAugmentPlayerManager);
31 | }};
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/sample/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.3.1'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | subprojects {
17 | afterEvaluate {project ->
18 | if (project.hasProperty("android")) {
19 | android {
20 | compileSdkVersion 28
21 | }
22 | }
23 | }
24 | }
25 |
26 | allprojects {
27 | repositories {
28 | mavenLocal()
29 | jcenter()
30 | maven {
31 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
32 | url "$rootDir/../node_modules/react-native/android"
33 | }
34 | maven {
35 | url 'https://maven.google.com'
36 | }
37 | maven { url "https://dl.bintray.com/augment/augment" }
38 | maven { url 'https://jitpack.io' }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentPlayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // AugmentReactPlayerView.h
3 | //
4 | // Copyright © 2017 - Present Augment. All rights reserved.
5 | //
6 |
7 | #import
8 | #import
9 | #import
10 | #import
11 |
12 | @class RNAugmentPlayer;
13 |
14 | @interface RNAugmentPlayer : UIView
15 | @property (nonatomic, copy) RCTBubblingEventBlock onPlayerReady;
16 | @property (nonatomic, copy) RCTBubblingEventBlock onInitializationFailed;
17 | @property (nonatomic, copy) RCTBubblingEventBlock onLoadingProgressDidChange;
18 | @property (nonatomic, copy) RCTBubblingEventBlock onLoadingDidFinish;
19 | @property (nonatomic, copy) RCTBubblingEventBlock onModelGesture;
20 | @property (nonatomic, copy) RCTBubblingEventBlock onTrackingStatusChanged;
21 |
22 | - (instancetype)initWithBridge:(RCTBridge *)bridge;
23 | - (void) addProduct:(NSDictionary*)product resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter;
24 | - (void) recenterProducts:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter;
25 | - (void) takeScreenshot:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter;
26 | @end
27 |
--------------------------------------------------------------------------------
/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 | ### Requirements
3 |
4 | * Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
5 | * All new code requires tests to ensure against regressions
6 |
7 |
8 | ### Description of the Change
9 |
10 |
11 | ### Benefits
12 |
13 |
14 | ### Possible Drawbacks
15 |
16 |
17 | ### Verification Process
18 |
19 |
30 |
31 |
32 | ### Applicable Issues
33 |
34 |
35 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/java/com/sample_menu/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.sample_menu;
2 |
3 | import android.app.Application;
4 |
5 | import com.facebook.react.ReactApplication;
6 | import com.augment.reactplugin.AugmentReactPackage;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.shell.MainReactPackage;
10 | import com.facebook.soloader.SoLoader;
11 |
12 | import java.util.Arrays;
13 | import java.util.List;
14 |
15 | public class MainApplication extends Application implements ReactApplication {
16 |
17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
18 | @Override
19 | public boolean getUseDeveloperSupport() {
20 | return BuildConfig.DEBUG;
21 | }
22 |
23 | @Override
24 | protected List getPackages() {
25 | return Arrays.asList(
26 | new MainReactPackage(),
27 | new AugmentReactPackage()
28 | );
29 | }
30 |
31 | @Override
32 | protected String getJSMainModuleName() {
33 | return "index";
34 | }
35 | };
36 |
37 | @Override
38 | public ReactNativeHost getReactNativeHost() {
39 | return mReactNativeHost;
40 | }
41 |
42 | @Override
43 | public void onCreate() {
44 | super.onCreate();
45 | SoLoader.init(this, /* native exopackage */ false);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 |
13 | @implementation AppDelegate
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16 | {
17 | NSURL *jsCodeLocation;
18 |
19 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
20 |
21 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
22 | moduleName:@"sample_menu"
23 | initialProperties:nil
24 | launchOptions:launchOptions];
25 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
26 |
27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
28 | UIViewController *rootViewController = [UIViewController new];
29 | rootViewController.view = rootView;
30 | self.window.rootViewController = rootViewController;
31 | [self.window makeKeyAndVisible];
32 | return YES;
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/sample/src/HomeScreen.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { View, Text, StyleSheet, Button, Image } from 'react-native';
3 | import { StackNavigator } from 'react-navigation';
4 | import { YellowBox } from 'react-native';
5 |
6 | export default class HomeScreen extends React.Component {
7 | render() {
8 | return (
9 |
10 | Augment React Native Sample
11 |
21 | );
22 | }
23 | }
24 |
25 | const styles = StyleSheet.create({
26 | buttonContainer: {
27 | flex: 0,
28 | margin: 8,
29 | borderRadius: 5,
30 | flexDirection: "row",
31 | justifyContent: "space-around"
32 | },
33 | button: {
34 | flex: 1,
35 | height: 48,
36 | backgroundColor: "skyblue"
37 | }
38 | });
39 |
40 | YellowBox.ignoreWarnings([
41 | 'Warning: componentWillMount is deprecated',
42 | 'Warning: componentWillReceiveProps is deprecated',
43 | 'Warning: isMounted(...) is deprecated',
44 | 'Module',
45 | 'Warning: Class RCTxxModule'
46 | ]);
47 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | google()
5 | maven { url 'https://jitpack.io' }
6 | }
7 | dependencies {
8 | classpath("com.android.tools.build:gradle:3.4.2")
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | maven {
15 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
16 | url("$rootDir/../node_modules/react-native/android")
17 | }
18 | maven {
19 | // Android JSC is installed from npm
20 | url("$rootDir/../node_modules/jsc-android/dist")
21 | }
22 | google()
23 | jcenter()
24 | maven { url 'https://jitpack.io' }
25 | }
26 | }
27 |
28 | apply plugin: 'com.android.library'
29 |
30 | repositories {
31 | mavenCentral()
32 | mavenLocal()
33 | google()
34 | maven { url "https://dl.bintray.com/augment/augment" }
35 | maven { url 'https://jitpack.io' }
36 | }
37 |
38 | android {
39 | compileSdkVersion 28
40 |
41 | compileOptions {
42 | sourceCompatibility 1.8
43 | targetCompatibility 1.8
44 | }
45 |
46 | defaultConfig {
47 | minSdkVersion 24
48 | targetSdkVersion 28
49 | versionCode 1
50 | versionName "1.0"
51 | }
52 | }
53 |
54 | dependencies {
55 | implementation "com.facebook.react:react-native:+"
56 | implementation "com.google.zxing:core:3.2.1"
57 | implementation "com.drewnoakes:metadata-extractor:2.9.1"
58 | implementation "com.ar.augment:augment-player-sdk:2.0.0-beta1"
59 | }
60 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | .gradle
3 | /build/
4 | gradle-app.setting
5 | !gradle-wrapper.jar
6 | .gradletasknamecache
7 | *.apk
8 | *.ap_
9 | *.dex
10 | *.class
11 | bin/
12 | gen/
13 | out/
14 | .gradle/
15 | build/
16 | local.properties
17 | proguard/
18 | *.log
19 | .navigation/
20 | captures/
21 | *.iml
22 | .idea/
23 | .externalNativeBuild
24 | google-services.json
25 | freeline.py
26 | freeline/
27 | freeline_project_description.json
28 | fastlane/report.xml
29 | fastlane/Preview.html
30 | fastlane/screenshots
31 | fastlane/test_output
32 | fastlane/readme.md
33 | .DS_Store
34 | .AppleDouble
35 | .LSOverride
36 | Icon
37 | ._*
38 | .DocumentRevisions-V100
39 | .fseventsd
40 | .Spotlight-V100
41 | .TemporaryItems
42 | .Trashes
43 | .VolumeIcon.icns
44 | .com.apple.timemachine.donotpresent
45 | .AppleDB
46 | .AppleDesktop
47 | Network Trash Folder
48 | Temporary Items
49 | .apdisk
50 | .idea/**/workspace.xml
51 | .idea/**/tasks.xml
52 | .idea/**/dictionaries
53 | .idea/**/shelf
54 | .idea/**/dataSources/
55 | .idea/**/dataSources.ids
56 | .idea/**/dataSources.local.xml
57 | .idea/**/sqlDataSources.xml
58 | .idea/**/dynamic.xml
59 | .idea/**/uiDesigner.xml
60 | .idea/**/gradle.xml
61 | .idea/**/libraries
62 | cmake-build-debug/
63 | cmake-build-release/
64 | .idea/**/mongoSettings.xml
65 | *.iws
66 | out/
67 | .idea_modules/
68 | atlassian-ide-plugin.xml
69 | .idea/replstate.xml
70 | com_crashlytics_export_strings.xml
71 | crashlytics.properties
72 | crashlytics-build.properties
73 | fabric.properties
74 | .idea/httpRequests
75 | *.class
76 | *.log
77 | *.ctxt
78 | .mtj.tmp/
79 | *.jar
80 | *.war
81 | *.nar
82 | *.ear
83 | *.zip
84 | *.tar.gz
85 | *.rar
86 | hs_err_pid*
87 |
--------------------------------------------------------------------------------
/src/AugmentPlayerSDK.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Wrapper for Augment React
3 | * documentation at: https://developers.augment.com
4 | */
5 | 'use strict';
6 |
7 | import React, { Component } from 'react'
8 | import {
9 | Platform,
10 | NativeEventEmitter,
11 | NativeModules,
12 | requireNativeComponent,
13 | ViewPropTypes,
14 | UIManager
15 | } from 'react-native'
16 | import PropTypes from 'prop-types'
17 |
18 | /**
19 | * This is the Native class interface for javascript only parts
20 | */
21 | const RNAugmentPlayerSDK = NativeModules.RNAugmentPlayerSDK
22 |
23 | // These are defined by the Native module and are main event sent by Augment SDK
24 | // AugmentReact.AUGMENT_EVENT_LOADING_PROGRESS
25 | // AugmentReact.AUGMENT_EVENT_LOADING_OVER
26 |
27 | /**
28 | * Extended version of the Player
29 | * That way we can enforce specifics behaviours
30 | */
31 | export default class AugmentPlayerSDK {
32 | static Constants = {
33 | AppID: RNAugmentPlayerSDK.AppID,
34 | AppKey: RNAugmentPlayerSDK.AppKey,
35 | Identifier: RNAugmentPlayerSDK.Identifier,
36 | Brand: RNAugmentPlayerSDK.Brand,
37 | Name: RNAugmentPlayerSDK.Name,
38 | EAN: RNAugmentPlayerSDK.EAN,
39 | };
40 |
41 | static init({id, key}): Promise {
42 | RNAugmentPlayerSDK.init({
43 | id: id,
44 | key: key
45 | });
46 | }
47 |
48 | static async checkIfModelDoesExistForUserProduct(productToSearch): Promise {
49 | return await RNAugmentPlayerSDK.checkIfModelDoesExistForUserProduct(productToSearch)
50 | }
51 |
52 | static isARKitAvailable(): Promise {
53 | return new Promise(resolve => {
54 | RNAugmentPlayerSDK.isARKitAvailable((isAvailable) => {
55 | resolve(isAvailable);
56 | })
57 | });
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/sample/android/app/BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15 | lib_deps.append(':' + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.sample_menu",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.sample_menu",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | sample_menu
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | NSCameraUsageDescription
20 | We need to access your Camera to show you Augmented reality
21 | CFBundleShortVersionString
22 | 1.0
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | 1
27 | LSRequiresIPhoneOS
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UIViewControllerBasedStatusBarAppearance
42 |
43 | NSLocationWhenInUseUsageDescription
44 |
45 | NSAppTransportSecurity
46 |
47 |
48 | NSExceptionDomains
49 |
50 | localhost
51 |
52 | NSExceptionAllowsInsecureHTTPLoads
53 |
54 | NSAllowsLocalNetworking
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/sample/ios/sample_menuTests/sample_menuTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | #import
12 | #import
13 |
14 | #define TIMEOUT_SECONDS 600
15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
16 |
17 | @interface sample_menuTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation sample_menuTests
22 |
23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
24 | {
25 | if (test(view)) {
26 | return YES;
27 | }
28 | for (UIView *subview in [view subviews]) {
29 | if ([self findSubviewInView:subview matching:test]) {
30 | return YES;
31 | }
32 | }
33 | return NO;
34 | }
35 |
36 | - (void)testRendersWelcomeScreen
37 | {
38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
40 | BOOL foundElement = NO;
41 |
42 | __block NSString *redboxError = nil;
43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
44 | if (level >= RCTLogLevelError) {
45 | redboxError = message;
46 | }
47 | });
48 |
49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
52 |
53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
55 | return YES;
56 | }
57 | return NO;
58 | }];
59 | }
60 |
61 | RCTSetLogFunction(RCTDefaultLogFunction);
62 |
63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
65 | }
66 |
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/sample/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 | All notable changes to this project will be documented in this file.
3 |
4 | The format is based on [Keep a Changelog](http://keepachangelog.com/)
5 | and this project adheres to [Semantic Versioning](http://semver.org/).
6 |
7 | ## [3.0.0-beta.4] - 2019-10-03
8 | ### Changed
9 | - React Native and dependencies updated: "react": "16.9.0"; "react-native": "0.61.2"
10 |
11 | ## [3.0.0-beta.3] - 2019-06-07
12 | ### Changed
13 | - Updated AndroidSDK `2.0.0-beta1`
14 |
15 | ## [3.0.0-beta.2] - 2019-06-07
16 | ### Changed
17 | - Updated AndroidSDK `2.0.0-alpha4`
18 |
19 | ## [3.0.0-beta.1] - 2019-05-22
20 | ### Added
21 | - AndroidSDK support
22 |
23 | ### Changed
24 | - React Native and dependencies updated: "react": "16.8.3"; "react-native": "0.59.5"
25 |
26 | ## [2.0.0] - 2018-09-10
27 | ### Changed
28 | - Using iOS SDK v4.0, removing the dependency on Vuforia
29 |
30 | ### Removed
31 | - Android SDK has been removed temporarily and all possible calls to `AugmentPlayerSDK` and `AugmentPlayer` have been stubbed.
32 |
33 | ### Breaking changes
34 | - `AugmentReact` and `AugmentReactPlayer` have been renamed `AugmentPlayerSDK` and `AugmentPlayer` to match native names.
35 | - Native listeners (gesture and tracking) have been removed in favor of component props
36 | - `addProduct`, `takeScreenshot` and `recenterProducts` have moved to AugmentPlayer component
37 | instead of being global functions.
38 |
39 | ## [1.5.1] - 2018-08-09
40 | ### Added
41 | - iOS: Expose isARKitAvailable
42 |
43 | ## [1.5.0] - 2018-07-25
44 | ### Changed
45 | - Using iOS SDK with ARKit
46 |
47 | ### Added
48 | - AR Tracking listener
49 | - Model Gesture listener
50 |
51 | ## [1.4.0] - 2018-05-30
52 | ### Changed
53 | - New code structure
54 |
55 | ### Added
56 | - Exposed takeScreenshot method
57 |
58 | ### Fixed
59 | - iOS: Second AR launch not working
60 | - Android: Two models appear when coming back from background
61 |
62 | ## [1.3.3] - 2018-03-20
63 | ### Changed
64 | - Augment SDK version to `1.0.3`
65 |
66 | ### Fixed
67 | - Catch exceptions on the de-initialisation of Vuforia and lifecycle events.
68 |
69 | ## [1.3.2] - 2018-03-06
70 | ### Fixed
71 | - Avoid exception for Product being null
72 |
73 | ## [1.3.1] - 2018-03-01
74 | ### Changed
75 | - Default path for Framework (Header) Search's
76 |
77 | ## [1.3.0] - 2018-02-27
78 | ### Fixed
79 | - augmentSDK header imports
80 |
81 | ## [1.2.0] - 2018-02-12
82 | ### Changed
83 | - Use PropTypes
84 |
85 | ## [1.1.0] - 2017-05-10
86 | ### Changed
87 | - Use promise instead of callbacks, please se the doc to check how it will affect your code
88 |
89 | ## [1.0.1] - 2017-05-05
90 | ### Added
91 | - Documentation
92 |
93 | ### Fixed
94 | - Wrong index file for package
95 |
96 | ## [1.0.0] - 2017-05-02
97 | ### Added
98 | - First public version
99 |
--------------------------------------------------------------------------------
/sample/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Disabling obfuscation is useful if you collect stack traces from production crashes
20 | # (unless you are using a system that supports de-obfuscate the stack traces).
21 | -dontobfuscate
22 |
23 | # React Native
24 |
25 | # Keep our interfaces so they can be used by other ProGuard rules.
26 | # See http://sourceforge.net/p/proguard/bugs/466/
27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30 |
31 | # Do not strip any method/class that is annotated with @DoNotStrip
32 | -keep @com.facebook.proguard.annotations.DoNotStrip class *
33 | -keep @com.facebook.common.internal.DoNotStrip class *
34 | -keepclassmembers class * {
35 | @com.facebook.proguard.annotations.DoNotStrip *;
36 | @com.facebook.common.internal.DoNotStrip *;
37 | }
38 |
39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40 | void set*(***);
41 | *** get*();
42 | }
43 |
44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; }
46 | -keepclassmembers,includedescriptorclasses class * { native ; }
47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; }
48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; }
49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; }
50 |
51 | -dontwarn com.facebook.react.**
52 |
53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55 | -dontwarn android.text.StaticLayout
56 |
57 | # okhttp
58 |
59 | -keepattributes Signature
60 | -keepattributes *Annotation*
61 | -keep class okhttp3.** { *; }
62 | -keep interface okhttp3.** { *; }
63 | -dontwarn okhttp3.**
64 |
65 | # okio
66 |
67 | -keep class sun.misc.Unsafe { *; }
68 | -dontwarn java.nio.file.*
69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70 | -dontwarn okio.**
71 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '9.0'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | target 'react-native-augment' do
5 | # Pods for react-native-augment
6 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
7 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
8 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
9 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
10 | pod 'React', :path => '../node_modules/react-native/'
11 | pod 'React-Core', :path => '../node_modules/react-native/'
12 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
13 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
14 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
15 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
16 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
17 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
18 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
19 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
20 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
21 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
22 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
23 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
24 |
25 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
26 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
27 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
28 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
29 | pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
30 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
31 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
32 |
33 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
34 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
35 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
36 |
37 | target 'react-native-augmentTests' do
38 | inherit! :search_paths
39 | # Pods for testing
40 | end
41 |
42 | use_native_modules!
43 | end
44 |
45 | target 'react-native-augment-tvOS' do
46 | # Pods for react-native-augment-tvOS
47 |
48 | target 'react-native-augment-tvOSTests' do
49 | inherit! :search_paths
50 | # Pods for testing
51 | end
52 |
53 | end
54 |
--------------------------------------------------------------------------------
/android/src/main/java/com/augment/reactplugin/RNAugmentPlayerSDK.java:
--------------------------------------------------------------------------------
1 | package com.augment.reactplugin;
2 |
3 | import com.ar.augment.arplayer.sdk.AugmentSDK;
4 | import com.ar.augment.arplayer.services.payloads.ProductQuery;
5 | import com.facebook.react.bridge.Arguments;
6 | import com.facebook.react.bridge.Callback;
7 | import com.facebook.react.bridge.Promise;
8 | import com.facebook.react.bridge.ReactApplicationContext;
9 | import com.facebook.react.bridge.ReactContextBaseJavaModule;
10 | import com.facebook.react.bridge.ReactMethod;
11 | import com.facebook.react.bridge.ReadableMap;
12 | import com.facebook.react.bridge.WritableMap;
13 |
14 | import javax.annotation.Nonnull;
15 |
16 | import kotlin.Unit;
17 |
18 | public class RNAugmentPlayerSDK extends ReactContextBaseJavaModule {
19 | public RNAugmentPlayerSDK(@Nonnull ReactApplicationContext reactContext) {
20 | super(reactContext);
21 | }
22 |
23 | @Nonnull
24 | @Override
25 | public String getName() {
26 | return RNAugmentPlayerSDK.class.getSimpleName();
27 | }
28 |
29 | @ReactMethod
30 | public void init(ReadableMap sdkCredentialsMap) {
31 | // Added on the Manifest
32 | }
33 |
34 | @ReactMethod
35 | public void isARKitAvailable(Callback callback) {
36 | callback.invoke(true);
37 | }
38 |
39 | /**
40 | * This method corresponds to `AugmentReact.checkIfModelDoesExistForUserProduct`
41 | * product is a Map object that represent a product
42 | * it has "identifier" "brand" "name" and "ean" keys
43 | * This method returns an augmentProduct through the React promise mechanism
44 | */
45 | @ReactMethod
46 | public void checkIfModelDoesExistForUserProduct(ReadableMap productMap, Promise promise) {
47 | AugmentSDK.getInstance()
48 | .getProductsDataController()
49 | .checkIfModelDoesExistForUserProductQuery(
50 | new ProductQuery(
51 | productMap.getString(RNAugmentPlayerProductKeys.IDENTIFIER),
52 | productMap.getString(RNAugmentPlayerProductKeys.BRAND),
53 | productMap.getString(RNAugmentPlayerProductKeys.NAME)),
54 | (product, error) -> {
55 | if (error != null || product == null) {
56 | promise.reject("500", error == null ? "Product doesn't exist" : error.getMessage());
57 | } else {
58 | WritableMap map = Arguments.createMap();
59 | map.putString(RNAugmentPlayerProductKeys.IDENTIFIER, product.getIdentifier());
60 | map.putString(RNAugmentPlayerProductKeys.BRAND, product.getBrand());
61 | map.putString(RNAugmentPlayerProductKeys.NAME, product.getName());
62 | map.putString(RNAugmentPlayerProductKeys.EAN, product.getEan());
63 | promise.resolve(map);
64 | }
65 | return Unit.INSTANCE;
66 | });
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, gender identity and expression, level of experience,
9 | education, socio-economic status, nationality, personal appearance, race,
10 | religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at dev@augment.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentPlayerSDK.m:
--------------------------------------------------------------------------------
1 | //
2 | // ReactAugmentManager.m
3 | //
4 | // Copyright © 2017 - Present Augment. All rights reserved.
5 | //
6 |
7 | #import "RNAugmentPlayerSDK.h"
8 | #import "RNAugmentPlayer.h"
9 | #import "RNAugmentReactConstants.h"
10 | #import
11 |
12 | @implementation RNAugmentPlayerSDK
13 |
14 | static AGTAugmentSDK *augmentSDK;
15 |
16 | RCT_EXPORT_MODULE(RNAugmentPlayerSDK);
17 |
18 | - (NSDictionary*) constantsToExport {
19 | return @{
20 | @"AppID": kRNAppID,
21 | @"AppKey": kRNAppKey,
22 | @"Identifier": kRNProductIdentifierKey,
23 | @"Brand": kRNProductBrandKey,
24 | @"Name": kRNProductNameKey,
25 | @"EAN": kRNProductEANKey
26 | };
27 | }
28 |
29 | - (NSArray *)supportedEvents {
30 | return @[];
31 | }
32 |
33 | + (AGTAugmentSDK*) augmentSDK {
34 | return augmentSDK;
35 | }
36 |
37 | + (BOOL)requiresMainQueueSetup { return YES; }
38 |
39 | /**
40 | * This method corresponds to `AugmentReact.init`
41 | * data is a Map object with "id" "key" "vuforia" keys
42 | */
43 | RCT_EXPORT_METHOD(init: (NSDictionary*) data) {
44 |
45 | // Define a delegate for when a player will be instantiated
46 | // From that point we will start the AR session
47 | // @see AugmentPlayer for more information
48 | // [AugmentPlayer setInstantiationDelegate: self];
49 |
50 | static dispatch_once_t onceToken;
51 | dispatch_once(&onceToken, ^{
52 | augmentSDK = [[AGTAugmentSDK alloc] initWithClientID:data[kRNAppID] clientSecret:data[kRNAppKey]];
53 | });
54 | }
55 |
56 | /**
57 | * This method corresponds to `AugmentReact.checkIfModelDoesExistForUserProduct`
58 | * product is a Map object that represent a product
59 | * it has "identifier" "brand" "name" and "ean" keys
60 | * This method returns an augmentProduct through the React callback mechanism
61 | */
62 | RCT_EXPORT_METHOD(checkIfModelDoesExistForUserProduct:(NSDictionary *)product resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter) {
63 | [RNAugmentPlayerSDK.augmentSDK.productsDataController checkIfModelDoesExistForProductIdentifier: product[kRNProductIdentifierKey] brand: product[kRNProductBrandKey] name: product[kRNProductNameKey] EAN: product[kRNProductEANKey] completion: ^(id _Nullable augmentProduct, NSError* _Nullable error) {
64 |
65 | if (error != nil) {
66 | rejecter(@"ReactAugmentManager", error.localizedDescription, error);
67 | return;
68 | }
69 |
70 | if (augmentProduct != nil){
71 | resolver([self getDictionaryForProduct: augmentProduct]);
72 | }
73 | }];
74 | }
75 |
76 | RCT_EXPORT_METHOD(isARKitAvailable:(RCTResponseSenderBlock)callback) {
77 | BOOL isARKitAvailable = NO;
78 | if (@available(iOS 11.0, *)) {
79 | if ([ARWorldTrackingConfiguration isSupported]) {
80 | isARKitAvailable = YES;
81 | }
82 | }
83 | callback(@[[NSNull null], @(isARKitAvailable)]);
84 | }
85 |
86 | #pragma mark - Helpers
87 |
88 | /**
89 | * Convert an AGTProduct object to a NSDictionary
90 | */
91 | - (NSDictionary*) getDictionaryForProduct: (id) product {
92 | return @{
93 | kRNProductIdentifierKey: product.identifier,
94 | kRNProductBrandKey: product.brand,
95 | kRNProductNameKey: product.name,
96 | kRNProductEANKey: product.ean ? : @""
97 | };
98 | }
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/AugmentPlayer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import {
3 | View,
4 | Platform,
5 | NativeEventEmitter,
6 | NativeModules,
7 | findNodeHandle,
8 | requireNativeComponent,
9 | ViewPropTypes,
10 | UIManager
11 | } from 'react-native'
12 | import PropTypes from 'prop-types'
13 |
14 | let _RNAugmentPlayer;
15 | let _RNAugmentPlayerManager;
16 |
17 | _RNAugmentPlayer = requireNativeComponent('RNAugmentPlayer', AugmentPlayer, {
18 | nativeOnly: {
19 | onPlayerReady: true,
20 | onInitializationFailed: true,
21 | onTrackingStatusChanged: true,
22 | onModelGesture: true
23 | },
24 | })
25 | _RNAugmentPlayerManager = NativeModules.RNAugmentPlayer
26 |
27 | const RNAugmentPlayer = _RNAugmentPlayer;
28 | const RNAugmentPlayerManager = _RNAugmentPlayerManager;
29 |
30 | /**
31 | * Extended version of the Player
32 | * That way we can enforce specifics behaviours
33 | */
34 | export default class AugmentPlayer extends React.Component {
35 | static Constants = {
36 | ModelGesture: RNAugmentPlayerManager.ModelGesture,
37 | TrackingStatus: RNAugmentPlayerManager.TrackingStatus
38 | };
39 |
40 | static propTypes = {
41 | ...ViewPropTypes,
42 | // loaderCallback((loaderObject: [progress: int, show: bool]) => void)
43 | loaderCallback: PropTypes.func,
44 | // onPlayerReady(player: AugmentReactPlayer, errorCallback: (error: [error: string]) => void)
45 | onPlayerReady: PropTypes.func,
46 | onInitializationFailed: PropTypes.func,
47 | onTrackingStatusChanged: PropTypes.func,
48 | onModelGesture: PropTypes.func,
49 | }
50 |
51 | constructor(props) {
52 | super(props);
53 | }
54 |
55 | componentDidMount() {
56 | if (Platform.OS === 'android')
57 | this._create();
58 | }
59 |
60 | _create = () => {
61 | UIManager.dispatchViewManagerCommand(
62 | findNodeHandle(this._playerRef),
63 | UIManager.getViewManagerConfig('RNAugmentPlayer').Commands.create,
64 | [] // No args
65 | )
66 | }
67 |
68 | render() {
69 | return (
70 |
80 | );
81 | }
82 |
83 | _setReference = (ref: ?Object) => {
84 | if (ref) {
85 | this._playerRef = ref;
86 | this._playerHandle = findNodeHandle(ref);
87 | } else {
88 | this._playerRef = null;
89 | this._playerHandle = null;
90 | }
91 | };
92 |
93 | _onPlayerReady = () => {
94 | if (this.props.onPlayerReady) {
95 | this.props.onPlayerReady(this);
96 | }
97 | }
98 |
99 | _onInitializationFailed = () => {
100 | if (this.props.onInitializationFailed) {
101 | this.props.onInitializationFailed(this);
102 | }
103 | }
104 |
105 | _handleLoadingProgress = ({ nativeEvent }: EventCallbackArgumentsType) => {
106 | if (this.props.loaderCallback) {
107 | this.props.loaderCallback({"show": true, "progress": nativeEvent.progress});
108 | }
109 | }
110 |
111 | _handleLoadingOver = () => {
112 | if (this.props.loaderCallback) {
113 | this.props.loaderCallback({"show": false, "progress": 100});
114 | }
115 | }
116 |
117 | _onTrackingStatusChanged = ({ nativeEvent }: EventCallbackArgumentsType) => {
118 | if (this.props.onTrackingStatusChanged) {
119 | this.props.onTrackingStatusChanged(nativeEvent);
120 | }
121 | }
122 |
123 | _onModelGesture = ({ nativeEvent }: EventCallbackArgumentsType) => {
124 | if (this.props.onModelGesture) {
125 | this.props.onModelGesture(nativeEvent);
126 | }
127 | }
128 |
129 | async recenterProducts() {
130 | return await RNAugmentPlayerManager.recenterProducts(this._playerHandle);
131 | }
132 |
133 | async takeScreenshot() {
134 | return await RNAugmentPlayerManager.takeScreenshot(this._playerHandle);
135 | }
136 |
137 | async addProduct(product) {
138 | return await RNAugmentPlayerManager.addProduct(this._playerHandle, product);
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentPlayerManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // ReactAugmentViewManager.m
3 | //
4 | // Copyright © 2017 - Present Augment. All rights reserved.
5 | //
6 |
7 | #import "RNAugmentPlayerManager.h"
8 | #import "RNAugmentPlayer.h"
9 | #import "RNAugmentReactConstants.h"
10 | #import
11 | #import
12 | #import
13 | #import
14 | #import
15 | #import
16 |
17 | @import AugmentPlayerSDK;
18 |
19 | @implementation RNAugmentPlayerManager
20 |
21 | RCT_EXPORT_MODULE(RNAugmentPlayer)
22 |
23 | RCT_EXPORT_VIEW_PROPERTY(onPlayerReady, RCTBubblingEventBlock)
24 | RCT_EXPORT_VIEW_PROPERTY(onInitializationFailed, RCTBubblingEventBlock)
25 | RCT_EXPORT_VIEW_PROPERTY(onLoadingProgressDidChange, RCTBubblingEventBlock)
26 | RCT_EXPORT_VIEW_PROPERTY(onLoadingDidFinish, RCTBubblingEventBlock)
27 | RCT_EXPORT_VIEW_PROPERTY(onModelGesture, RCTBubblingEventBlock)
28 | RCT_EXPORT_VIEW_PROPERTY(onTrackingStatusChanged, RCTBubblingEventBlock)
29 |
30 | + (BOOL)requiresMainQueueSetup
31 | {
32 | return YES;
33 | }
34 |
35 | - (UIView*) view
36 | {
37 | return [[RNAugmentPlayer alloc] initWithBridge:self.bridge];
38 | }
39 |
40 | - (NSArray *)supportedEvents
41 | {
42 | return @[
43 | @"onPlayerReady",
44 | @"onInitializationFailed",
45 | @"onLoadingProgressDidChange",
46 | @"onLoadingDidFinish",
47 | @"onModelGesture",
48 | @"onTrackingStatusChanged"
49 | ];
50 | }
51 |
52 | - (NSDictionary*) constantsToExport {
53 | return @{
54 | @"ModelGesture": @{
55 | @"added": @(RNModelGestureEventAdded),
56 | @"translated": @(RNModelGestureEventTranslated),
57 | @"rotated": @(RNModelGestureEventRotated)
58 | },
59 | @"TrackingStatus": @{
60 | @"error": @(AGTTrackingStatusError),
61 | @"featuresDetected": @(AGTTrackingStatusFeaturesDetected),
62 | @"initializing": @(AGTTrackingStatusInitializing),
63 | @"limitedExcessiveMotion": @(AGTTrackingStatusLimitedExcessiveMotion),
64 | @"limitedInsufficientFeatures": @(AGTTrackingStatusLimitedInsufficientFeatures),
65 | @"limitedRelocalizing": @(AGTTrackingStatusLimitedRelocalizing),
66 | @"normal": @(AGTTrackingStatusNormal),
67 | @"notAvailable": @(AGTTrackingStatusNotAvailable),
68 | @"planeDetected": @(AGTTrackingStatusPlaneDetected),
69 | @"trackerDetected": @(AGTTrackingStatusTrackerDetected)
70 | }
71 | };
72 | }
73 |
74 |
75 | RCT_REMAP_METHOD(addProduct,
76 | reactTag:(nonnull NSNumber *)reactTag
77 | product:(NSDictionary *)product
78 | resolver:(RCTPromiseResolveBlock)resolve
79 | rejecter:(RCTPromiseRejectBlock)reject)
80 | {
81 | [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) {
82 | RNAugmentPlayer *view = viewRegistry[reactTag];
83 | if (![view isKindOfClass:[RNAugmentPlayer class]]) {
84 | RCTLogError(@"Invalid view returned from registry, expecting AugmentPlayer, got: %@", view);
85 | } else {
86 | [view addProduct:product resolver:resolve rejecter:reject];
87 | }
88 | }];
89 | }
90 |
91 | RCT_REMAP_METHOD(recenterProducts,
92 | recenterProducts:(nonnull NSNumber *)reactTag
93 | resolver:(RCTPromiseResolveBlock)resolve
94 | rejecter:(RCTPromiseRejectBlock)reject)
95 | {
96 | [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) {
97 | RNAugmentPlayer *view = viewRegistry[reactTag];
98 | if (![view isKindOfClass:[RNAugmentPlayer class]]) {
99 | RCTLogError(@"Invalid view returned from registry, expecting AugmentPlayer, got: %@", view);
100 | } else {
101 | [view recenterProducts:resolve rejecter:reject];
102 | }
103 | }];
104 | }
105 |
106 |
107 | RCT_REMAP_METHOD(takeScreenshot,
108 | takeScreenshot:(nonnull NSNumber *)reactTag
109 | resolver:(RCTPromiseResolveBlock)resolve
110 | rejecter:(RCTPromiseRejectBlock)reject)
111 | {
112 | [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) {
113 | RNAugmentPlayer *view = viewRegistry[reactTag];
114 | if (![view isKindOfClass:[RNAugmentPlayer class]]) {
115 | RCTLogError(@"Invalid view returned from registry, expecting AugmentPlayer, got: %@", view);
116 | } else {
117 | [view takeScreenshot:resolve rejecter:reject];
118 | }
119 | }];
120 | }
121 |
122 | @end
123 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu/Augment.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/sample/android/app/src/main/assets/Augment.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/android/src/main/java/com/augment/reactplugin/RNAugmentPlayerManager.java:
--------------------------------------------------------------------------------
1 | package com.augment.reactplugin;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | import com.ar.augment.arplayer.sdk.TrackingStatus;
6 | import com.facebook.react.bridge.Promise;
7 | import com.facebook.react.bridge.ReactContext;
8 | import com.facebook.react.bridge.ReactMethod;
9 | import com.facebook.react.bridge.ReadableArray;
10 | import com.facebook.react.bridge.ReadableMap;
11 | import com.facebook.react.common.MapBuilder;
12 | import com.facebook.react.uimanager.ThemedReactContext;
13 | import com.facebook.react.uimanager.ViewGroupManager;
14 |
15 | import org.jetbrains.annotations.NotNull;
16 |
17 | import java.util.HashMap;
18 | import java.util.Map;
19 |
20 | import javax.annotation.Nonnull;
21 | import javax.annotation.Nullable;
22 |
23 | public class RNAugmentPlayerManager extends ViewGroupManager {
24 | private static final int COMMAND_CREATE = 12;
25 | private RNAugmentPlayer rnAugmentPlayer;
26 |
27 | @Nonnull
28 | @Override
29 | public String getName() {
30 | return "RNAugmentPlayer";
31 | }
32 |
33 | @Nonnull
34 | @Override
35 | protected RNAugmentPlayer createViewInstance(@Nonnull ThemedReactContext reactContext) {
36 | rnAugmentPlayer = new RNAugmentPlayer(reactContext);
37 | return rnAugmentPlayer;
38 | }
39 |
40 | @Override
41 | public void onDropViewInstance(@Nonnull RNAugmentPlayer view) {
42 | super.onDropViewInstance(view);
43 | rnAugmentPlayer.removeFragment(view);
44 | }
45 |
46 | @Nullable
47 | @Override
48 | public Map getCommandsMap() {
49 | return MapBuilder.of(
50 | "create", COMMAND_CREATE
51 | );
52 | }
53 |
54 | @Override
55 | public void receiveCommand(@Nonnull RNAugmentPlayer root, int commandId, @Nullable ReadableArray args) {
56 | switch (commandId) {
57 | case COMMAND_CREATE:
58 | rnAugmentPlayer.createFragment((ReactContext) root.getContext());
59 | break;
60 | }
61 | }
62 |
63 | /**
64 | * This method corresponds to `AugmentReact.addProductToAugmentPlayer`
65 | * data is a Map object that represent a product
66 | * it has "identifier" "brand" "name" and "ean" keys
67 | * This method needs to be called after the success of `AugmentReact.start`
68 | */
69 | @ReactMethod
70 | public void addProduct(int reactTag, ReadableMap productMap, Promise promise) {
71 | rnAugmentPlayer.addProduct(productMap, promise);
72 | }
73 |
74 | /**
75 | * This method corresponds to `AugmentReact.recenterProducts`
76 | * This method needs to be called after the success of `AugmentReact.start`
77 | */
78 | @ReactMethod
79 | public void recenterProducts(int reactTag, Promise promise) {
80 | promise.reject("500", "Error: Not available");
81 | }
82 |
83 |
84 | @ReactMethod
85 | public void takeScreenshot(int reactTag, @NonNull final Promise promise) {
86 | rnAugmentPlayer.takeScreenshot(promise);
87 | }
88 |
89 | public Map getExportedCustomBubblingEventTypeConstants() {
90 | return MapBuilder.builder()
91 | .put(RNAugmentPlayerEvent.onPlayerReady.toString(), getBubbledEventMapFor(RNAugmentPlayerEvent.onPlayerReady.toString()))
92 | .put(RNAugmentPlayerEvent.onInitializationFailed.toString(), getBubbledEventMapFor(RNAugmentPlayerEvent.onInitializationFailed.toString()))
93 | .put(RNAugmentPlayerEvent.onLoadingProgressDidChange.toString(), getBubbledEventMapFor(RNAugmentPlayerEvent.onLoadingProgressDidChange.toString()))
94 | .put(RNAugmentPlayerEvent.onLoadingDidFinish.toString(), getBubbledEventMapFor(RNAugmentPlayerEvent.onLoadingDidFinish.toString()))
95 | .put(RNAugmentPlayerEvent.onTrackingStatusChanged.toString(), getBubbledEventMapFor(RNAugmentPlayerEvent.onTrackingStatusChanged.toString()))
96 | .put(RNAugmentPlayerEvent.onModelGesture.toString(), getBubbledEventMapFor(RNAugmentPlayerEvent.onModelGesture.toString()))
97 | .build();
98 | }
99 |
100 | @Nullable
101 | @Override
102 | public Map getConstants() {
103 | return new HashMap() {{
104 | put("ModelGesture", "");
105 | put("TrackingStatus", new HashMap() {{
106 | put("error", TrackingStatus.ERROR.toString());
107 | put("initializing", TrackingStatus.INITIALIZING.toString());
108 | put("normal", TrackingStatus.NORMAL.toString());
109 | put("limitedExcessiveMotion", TrackingStatus.LIMITED_EXCESSIVE_MOTION.toString());
110 | put("limitedInsufficientFeatures", TrackingStatus.LIMITED_INSUFFICIENT_FEATURES.toString());
111 | put("notAvailable", TrackingStatus.NOT_AVAILABLE.toString());
112 | }});
113 | }};
114 | }
115 |
116 | @NotNull
117 | private Map> getBubbledEventMapFor(@Nonnull String event) {
118 | return MapBuilder.of(
119 | "phasedRegistrationNames",
120 | MapBuilder.of("bubbled", event));
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu.xcodeproj/xcshareddata/xcschemes/sample_menu-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/sample/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/sample/ios/sample_menu.xcodeproj/xcshareddata/xcschemes/sample_menu.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
107 |
108 |
109 |
110 |
111 |
112 |
118 |
120 |
126 |
127 |
128 |
129 |
131 |
132 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/android/src/main/java/com/augment/reactplugin/RNAugmentPlayer.java:
--------------------------------------------------------------------------------
1 | package com.augment.reactplugin;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.FrameLayout;
8 |
9 | import androidx.fragment.app.FragmentManager;
10 |
11 | import com.ar.augment.arplayer.model.Product;
12 | import com.ar.augment.arplayer.sdk.AugmentPlayer;
13 | import com.ar.augment.arplayer.sdk.AugmentPlayerFragment;
14 | import com.ar.augment.arplayer.sdk.AugmentSDK;
15 | import com.ar.augment.arplayer.sdk.TrackingStatus;
16 | import com.facebook.react.ReactActivity;
17 | import com.facebook.react.bridge.Arguments;
18 | import com.facebook.react.bridge.Promise;
19 | import com.facebook.react.bridge.ReactContext;
20 | import com.facebook.react.bridge.ReadableMap;
21 | import com.facebook.react.bridge.WritableMap;
22 | import com.facebook.react.uimanager.events.RCTEventEmitter;
23 |
24 | import kotlin.Unit;
25 |
26 | public class RNAugmentPlayer extends FrameLayout {
27 | private static final String AUGMENT_FRAGMENT_TAG = "AUGMENT_FRAGMENT_TAG";
28 | private AugmentPlayer augmentPlayer;
29 |
30 | public RNAugmentPlayer(Context context) {
31 | super(context);
32 | }
33 |
34 | public RNAugmentPlayer(Context context, AttributeSet attrs) {
35 | super(context, attrs);
36 | }
37 |
38 | public RNAugmentPlayer(Context context, AttributeSet attrs, int defStyleAttr) {
39 | super(context, attrs, defStyleAttr);
40 | }
41 |
42 | public void onReceiveNativeEvent(RNAugmentPlayerEvent event, WritableMap parametersMap) {
43 | ReactContext reactContext = (ReactContext) getContext();
44 | RCTEventEmitter eventEmitter = reactContext.getJSModule(RCTEventEmitter.class);
45 | eventEmitter.receiveEvent(
46 | getId(),
47 | event.toString(),
48 | parametersMap);
49 | }
50 |
51 | void createFragment(ReactContext context) {
52 | AugmentPlayerFragment fragment = new AugmentPlayerFragment();
53 | ReactActivity activity = (ReactActivity) context.getCurrentActivity();
54 | activity.getSupportFragmentManager()
55 | .beginTransaction()
56 | .add(fragment, AUGMENT_FRAGMENT_TAG)
57 | .commitNow();
58 | addView(fragment.getView(), 0);
59 | augmentPlayer = fragment.getAugmentPlayer();
60 | augmentPlayer.setTrackingStatusListener((trackingStatus, reason) -> {
61 | WritableMap paramsMap = Arguments.createMap();
62 | paramsMap.putString("status",
63 | // LIMITED_INSUFFICIENT_LIGHT doesn't exist on ios
64 | trackingStatus == TrackingStatus.LIMITED_INSUFFICIENT_LIGHT ?
65 | TrackingStatus.LIMITED_INSUFFICIENT_FEATURES.toString() :
66 | trackingStatus.name());
67 | paramsMap.putString("message", reason);
68 | onReceiveNativeEvent(RNAugmentPlayerEvent.onTrackingStatusChanged, paramsMap);
69 | });
70 | augmentPlayer.getViews().createLiveViewer(() -> {
71 | onReceiveNativeEvent(RNAugmentPlayerEvent.onPlayerReady, null);
72 | onReceiveNativeEvent(RNAugmentPlayerEvent.onLoadingDidFinish, null);
73 | ViewGroup view = (ViewGroup) fragment.getView();
74 | for (int i = 0; i < view.getChildCount(); i++) {
75 | View child = view.getChildAt(i);
76 | child.measure(
77 | View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), View.MeasureSpec.EXACTLY),
78 | View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), View.MeasureSpec.EXACTLY));
79 | child.layout(0, 0, child.getMeasuredWidth(), child.getMeasuredHeight());
80 | }
81 | return Unit.INSTANCE;
82 | });
83 | }
84 |
85 | void removeFragment(RNAugmentPlayer view) {
86 | ReactActivity activity = (ReactActivity) ((ReactContext) getContext()).getCurrentActivity();
87 | FragmentManager supportFragmentManager = activity.getSupportFragmentManager();
88 | view.removeAllViews();
89 | AugmentPlayerFragment fragment = (AugmentPlayerFragment) supportFragmentManager.findFragmentByTag(AUGMENT_FRAGMENT_TAG);
90 | augmentPlayer.setTrackingStatusListener(null);
91 | fragment.getAugmentPlayer().getViews().destroyCurrentViewer();
92 | supportFragmentManager
93 | .beginTransaction()
94 | .detach(fragment)
95 | .remove(fragment)
96 | .commit();
97 | }
98 |
99 | public void addProduct(ReadableMap productMap, Promise promise) {
100 | Product product = AugmentSDK.getInstance().getProductsDataController().getProduct(productMap.getString(RNAugmentPlayerProductKeys.IDENTIFIER));
101 | if (augmentPlayer != null) {
102 | ((ReactContext) getContext()).getCurrentActivity().runOnUiThread(() ->
103 | augmentPlayer.getContent().add(product.getModel3D(), (model3DInstance, error) -> {
104 | if (error != null) {
105 | promise.reject("500", error.getMessage());
106 | }
107 | if (model3DInstance != null) {
108 | promise.resolve(null);
109 | }
110 | return Unit.INSTANCE;
111 | }));
112 | }
113 | }
114 |
115 | public void takeScreenshot(Promise promise) {
116 | // augmentPlayer.takeScreenshot((bytes, error) -> {
117 | // if (error != null) {
118 | // promise.reject("500", error.getMessage());
119 | // }
120 | // promise.resolve(image's path);
121 | // return Unit.INSTANCE;
122 | // });
123 | promise.reject("500", "Not Available");
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/sample/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
37 | * // for example: to disable dev mode in the staging build type (if configured)
38 | * devDisabledInStaging: true,
39 | * // The configuration property can be in the following formats
40 | * // 'devDisabledIn${productFlavor}${buildType}'
41 | * // 'devDisabledIn${buildType}'
42 | *
43 | * // the root of your project, i.e. where "package.json" lives
44 | * root: "../../",
45 | *
46 | * // where to put the JS bundle asset in debug mode
47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
48 | *
49 | * // where to put the JS bundle asset in release mode
50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
51 | *
52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
53 | * // require('./image.png')), in debug mode
54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
55 | *
56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
57 | * // require('./image.png')), in release mode
58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
59 | *
60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
64 | * // for example, you might want to remove it from here.
65 | * inputExcludes: ["android/**", "ios/**"],
66 | *
67 | * // override which node gets called and with what additional arguments
68 | * nodeExecutableAndArgs: ["node"],
69 | *
70 | * // supply additional arguments to the packager
71 | * extraPackagerArgs: []
72 | * ]
73 | */
74 |
75 | project.ext.react = [
76 | entryFile: "index.js"
77 | ]
78 |
79 | apply from: "../../node_modules/react-native/react.gradle"
80 |
81 | /**
82 | * Set this to true to create two separate APKs instead of one:
83 | * - An APK that only works on ARM devices
84 | * - An APK that only works on x86 devices
85 | * The advantage is the size of the APK is reduced by about 4MB.
86 | * Upload all the APKs to the Play Store and people will download
87 | * the correct one based on the CPU architecture of their device.
88 | */
89 | def enableSeparateBuildPerCPUArchitecture = false
90 |
91 | /**
92 | * Run Proguard to shrink the Java bytecode in release builds.
93 | */
94 | def enableProguardInReleaseBuilds = false
95 |
96 | android {
97 | compileSdkVersion 28
98 |
99 | compileOptions {
100 | sourceCompatibility 1.8
101 | targetCompatibility 1.8
102 | }
103 |
104 | defaultConfig {
105 | applicationId "com.sample_menu"
106 | minSdkVersion 24
107 | targetSdkVersion 24
108 | versionCode 1
109 | versionName "1.0"
110 | ndk {
111 | abiFilters "armeabi-v7a", "x86"
112 | }
113 | }
114 | splits {
115 | abi {
116 | reset()
117 | enable enableSeparateBuildPerCPUArchitecture
118 | universalApk false // If true, also generate a universal APK
119 | include "armeabi-v7a", "x86"
120 | }
121 | }
122 | buildTypes {
123 | release {
124 | minifyEnabled enableProguardInReleaseBuilds
125 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
126 | }
127 | }
128 | // applicationVariants are e.g. debug, release
129 | applicationVariants.all { variant ->
130 | variant.outputs.each { output ->
131 | // For each separate APK per architecture, set a unique version code as described here:
132 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
133 | def versionCodes = ["armeabi-v7a":1, "x86":2]
134 | def abi = output.getFilter(OutputFile.ABI)
135 | if (abi != null) { // null for the universal-debug, universal-release variants
136 | output.versionCodeOverride =
137 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
138 | }
139 | }
140 | }
141 | }
142 |
143 | dependencies {
144 | implementation project(':react-native-augment')
145 | implementation fileTree(dir: "libs", include: ["*.jar"])
146 | implementation "com.android.support:appcompat-v7:23.0.1"
147 | implementation "com.facebook.react:react-native:+" // From node_modules
148 | }
149 |
150 | // Run this once to be able to run the application with BUCK
151 | // puts all compile dependencies into folder libs for BUCK to use
152 | task copyDownloadableDepsToLibs(type: Copy) {
153 | from configurations.compile
154 | into 'libs'
155 | }
156 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin, switch paths to Windows format before running java
129 | if $cygwin ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=$((i+1))
158 | done
159 | case $i in
160 | (0) set -- ;;
161 | (1) set -- "$args0" ;;
162 | (2) set -- "$args0" "$args1" ;;
163 | (3) set -- "$args0" "$args1" "$args2" ;;
164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=$(save "$@")
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 | cd "$(dirname "$0")"
186 | fi
187 |
188 | exec "$JAVACMD" "$@"
189 |
--------------------------------------------------------------------------------
/sample/src/ARScreen.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is an example of a react component that use Augment
3 | * It is bundled as an App so you can test it quick
4 | */
5 | import React, { Component } from 'react';
6 | import { AppRegistry, StyleSheet, View, Text, Button, NativeEventEmitter, NativeModules } from 'react-native';
7 | import { AugmentPlayerSDK, AugmentPlayer } from 'react-native-augment';
8 | import Toast, {DURATION} from 'react-native-easy-toast'
9 |
10 | export default class ARScreen extends React.Component {
11 |
12 | constructor(props) {
13 | super(props);
14 | this.state = {
15 | loaderText: "Loading ...",
16 | loaderShow: true
17 | };
18 | }
19 |
20 | render() {
21 | let displayMode = this.state.loaderShow ? "flex" : "none";
22 | return (
23 |
24 | { this.augmentPlayer = ref; }}
26 | onPlayerReady={this.business.bind(this)}
27 | onInitializationFailed={this.error.bind(this)}
28 | loaderCallback={this.loader.bind(this)}
29 | onTrackingStatusChanged={this.onTrackingStatusChanged.bind(this)}
30 | onModelGesture={this.onModelGesture.bind(this)}
31 | />
32 |
33 |
34 | {this.state.loaderText}
35 |
36 |
37 |
38 |
41 |
44 |
45 |
46 |
47 | );
48 | }
49 |
50 | loader(loaderStatus) {
51 | this.setState({
52 | loaderShow: loaderStatus.show,
53 | loaderText: "Loading " + loaderStatus.progress + "%"
54 | });
55 | }
56 |
57 | error() {
58 | console.log("error");
59 | }
60 |
61 | business(player, error) {
62 | if (error) {
63 | this.refs.toast.show(error.toString());
64 | return;
65 | }
66 |
67 | const { params } = this.props.navigation.state;
68 | productToSearch = params.productToSearch
69 |
70 | AugmentPlayerSDK.checkIfModelDoesExistForUserProduct(productToSearch)
71 | .then((product) => {
72 | player.addProduct(product)
73 | .then(() => {
74 | console.log("The product has been added to the ARView");
75 | })
76 | .catch((error) => {
77 | this.refs.toast.show(error.toString());
78 | });
79 | })
80 | .catch((error) => {
81 | this.refs.toast.show(error.toString());
82 | })
83 | }
84 |
85 | centerProduct() {
86 | this.augmentPlayer.recenterProducts()
87 | .catch((error) => {
88 | this.refs.toast.show(error.toString());
89 | });
90 | }
91 |
92 | takeScreenshot() {
93 | this.augmentPlayer.takeScreenshot()
94 | .then((filePath) => {
95 | console.log(filePath)
96 | alert(`Screenshot saved at ${filePath}`);
97 | })
98 | .catch((error) => {
99 | this.refs.toast.show(error.toString());
100 | });
101 | }
102 |
103 | onTrackingStatusChanged = ({ status, message }) => {
104 | switch (status) {
105 | case AugmentPlayer.Constants.TrackingStatus.error:
106 | console.log('An error occured during tracking: ' + message);
107 | break;
108 | case AugmentPlayer.Constants.TrackingStatus.featuresDetected:
109 | console.log('Tracking state changed to FeaturesDetected');
110 | break;
111 | case AugmentPlayer.Constants.TrackingStatus.initializing:
112 | console.log('Tracking state changed to Initializing');
113 | break;
114 | case AugmentPlayer.Constants.TrackingStatus.limitedExcessiveMotion:
115 | console.log('Tracking state changed to LimitedExcessiveMotion');
116 | break;
117 | case AugmentPlayer.Constants.TrackingStatus.limitedInsufficientFeatures:
118 | console.log('Tracking state changed to LimitedInsufficientFeatures');
119 | break;
120 | case AugmentPlayer.Constants.TrackingStatus.limitedRelocalizing:
121 | console.log('Tracking state changed to LimitedRelocalizing');
122 | break;
123 | case AugmentPlayer.Constants.TrackingStatus.normal:
124 | console.log('Tracking state changed to Normal');
125 | break;
126 | case AugmentPlayer.Constants.TrackingStatus.notAvailable:
127 | console.log('Tracking state changed to NotAvailable');
128 | break;
129 | case AugmentPlayer.Constants.TrackingStatus.planeDetected:
130 | console.log('Tracking state changed to PlaneDetected');
131 | break;
132 | case AugmentPlayer.Constants.TrackingStatus.trackerDetected:
133 | console.log('Tracking state changed to TrackerDetected');
134 | break;
135 | default:
136 | console.log("onTrackingStatusChanged" + status)
137 | }
138 | }
139 |
140 | onModelGesture = (event) => {
141 | switch (event.gesture) {
142 | case AugmentPlayer.Constants.ModelGesture.added:
143 | console.log('Model with uuid ' + event.model_uuid + " has been placed");
144 | break;
145 | case AugmentPlayer.Constants.ModelGesture.translated:
146 | console.log('Model with uuid ' + event.model_uuid + " has been translated");
147 | break;
148 | case AugmentPlayer.Constants.ModelGesture.rotated:
149 | console.log('Model with uuid ' + event.model_uuid + " has been rotated");
150 | break;
151 | }
152 | }
153 | }
154 |
155 | const styles = StyleSheet.create({
156 | container: {
157 | flex: 1,
158 | flexDirection: "column",
159 | backgroundColor: "lightgray"
160 | },
161 | augmentPlayer: {
162 | position: "absolute",
163 | top: 0,
164 | bottom: 0,
165 | left: 0,
166 | right: 0
167 | },
168 | loaderContainer: {
169 | flex: 1,
170 | justifyContent: "center",
171 | alignItems: "center"
172 | },
173 | loader: {
174 | backgroundColor: "white",
175 | padding: 16,
176 | borderRadius: 8
177 | },
178 | buttonContainer: {
179 | flex: 0,
180 | margin: 8,
181 | borderRadius: 5,
182 | flexDirection: "row",
183 | justifyContent: "space-around"
184 | },
185 | button: {
186 | flex: 1,
187 | height: 48,
188 | backgroundColor: "skyblue"
189 | }
190 | });
191 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 | Hi there! Interested in contributing to Augment? We’d love your help. `Augment/react-native-module` is an open source project, built one contribution at a time by users like you.
3 |
4 | ## Important!
5 |
6 | By contributing to this project, you:
7 |
8 | * Agree that you have authored 100% of the content
9 | * Agree that you have the necessary rights to the content
10 | * Agree that you have received the necessary permissions from your employer to make the contributions (if applicable)
11 | * Agree that the content you contribute may be provided under the Project license(s)
12 | * Agree that, if you did not author 100% of the content, the appropriate licenses and copyrights have been added along with any other necessary attribution.
13 |
14 | ## Code of Conduct
15 |
16 | This project and everyone participating in it is governed by the [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [support@augment.com](mailto:support@augment.com).
17 |
18 | ## Getting started
19 |
20 | **What does "contributing" mean?**
21 |
22 | Creating an issue is the simplest form of contributing to a project. But there are many ways to contribute, including the following:
23 |
24 | - Updating or correcting documentation
25 | - Feature requests
26 | - Bug reports
27 | - Pull Requests
28 | - Help evaluate [open pull requests](https://github.com/Augment/react-native-module/pulls), by testing the changes locally and reviewing what's proposed.
29 |
30 | ## Issues
31 |
32 | Please only create issues for bug reports or feature requests. Issues discussing any other topics may be closed by the project's maintainers without further explanation.
33 |
34 | Do not create issues about bumping dependencies unless a bug has been identified and you can demonstrate that it effects this library.
35 |
36 | **Help us to help you**
37 |
38 | Remember that we’re here to help, but not to make guesses about what you need help with:
39 |
40 | - Whatever bug or issue you're experiencing, assume that it will not be as obvious to the maintainers as it is to you.
41 | - Spell it out completely. Keep in mind that maintainers need to think about _all potential use cases_ of a library. It's important that you explain how you're using a library so that maintainers can make that connection and solve the issue.
42 |
43 | _It can't be understated how frustrating and draining it can be to maintainers to have to ask clarifying questions on the most basic things, before it's even possible to start debugging. Please try to make the best use of everyone's time involved, including yourself, by providing this information up front._
44 |
45 | ### Before creating an issue
46 |
47 | Please try to determine if the issue is caused by an underlying library, and if so, create the issue there. Sometimes this is difficult to know. We only ask that you attempt to give a reasonable attempt to find out. Oftentimes the readme will have advice about where to go to create issues.
48 |
49 | Try to follow these guidelines:
50 |
51 | - **Avoid creating issues for implementation help** - It's much better for discoverability, SEO, and semantics - to keep the issue tracker focused on bugs and feature requests - to ask implementation-related questions on [stackoverflow.com][so]
52 | - **Investigate the issue** - Search for existing issues (open or closed) that address the issue, and might have even resolved it already.
53 | - **Check the readme** - oftentimes you will find notes about creating issues, and where to go depending on the type of issue.
54 | - Create the issue in the appropriate repository.
55 |
56 | ### Creating an issue
57 |
58 | Please be as descriptive as possible when creating an issue. Give us the information we need to successfully answer your question or address your issue by answering the following in your issue:
59 |
60 | - **use a clear and descriptive title** for the issue to identify the problem.
61 | - **description**: (required) What is the bug you're experiencing? How are you using this library?
62 | - Describe the exact steps which reproduce the problem in as many details as possible.
63 | - Provide specific examples to demonstrate the steps. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use Markdown code blocks.
64 | - Describe the behavior you observed after following the steps and point out what exactly is the problem with that behavior.
65 | - If the problem started happening recently, can you reproduce the problem in an older version. What's the most recent version in which the problem doesn't happen?
66 | - Explain which behavior you expected to see instead and why.
67 | - **OS**: (required) what operating system are you on?
68 | - **version**: (required) please note the version of the module are you using
69 | - **error messages**: (required) please paste any error messages into the issue, or a [gist](https://gist.github.com/)
70 | - **extensions, plugins, helpers, etc** (if applicable): please list any extensions you're using
71 |
72 | ### Closing issues
73 |
74 | The original poster or the maintainers may close an issue at any time. Typically, but not exclusively, issues are closed when:
75 |
76 | - The issue is resolved
77 | - The project's maintainers have determined the issue is out of scope
78 | - An issue is clearly a duplicate of another issue, in which case the duplicate issue will be linked.
79 | - A discussion has clearly run its course
80 |
81 | ### Submitting a pull request
82 |
83 | Pull requests generally:
84 |
85 | - The smaller the proposed change, the better. If you’d like to propose two unrelated changes, submit two pull requests.
86 | - The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
87 | - Pull requests are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
88 |
89 | Find [an open issue](https://github.com/Augment/react-native-module/issues) (especially [those labeled `help-wanted`](https://github.com/Augment/react-native-module/labels/help%20wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions. Make sure to follow these rules:
90 |
91 | - Fill in [the required template](PULL_REQUEST_TEMPLATE.md)
92 | - Do not include issue numbers in the PR title
93 | - End all files with a newline
94 | - Use the present tense ("Add feature" not "Added feature") on commit messages
95 |
96 | ## Next steps
97 |
98 | **Tips for creating idiomatic issues**
99 |
100 | Spending just a little extra time to review best practices and brush up on your contributing skills will, at minimum, make your issue easier to read, easier to resolve, and more likely to be found by others who have the same or similar issue in the future. At best, it will open up doors and potential career opportunities by helping you be at your best.
101 |
102 | The following resources were hand-picked to help you be the most effective contributor you can be:
103 |
104 | - The [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) is a great place for newcomers to start, but there is also information for experienced contributors there.
105 | - Take some time to learn basic markdown. We can't stress this enough. Don't start pasting code into GitHub issues before you've taken a moment to review this [markdown cheatsheet](https://gist.github.com/jonschlinkert/5854601)
106 | - The GitHub guide to [basic markdown](https://help.github.com/articles/markdown-basics/) is another great markdown resource.
107 | - Learn about [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown/). And if you want to really go above and beyond, read [mastering markdown](https://guides.github.com/features/mastering-markdown/).
108 |
109 | At the very least, please try to:
110 |
111 | - Use backticks to wrap code. This ensures that it retains its formatting and isn't modified when it's rendered by GitHub, and makes the code more readable to others
112 | - When applicable, use syntax highlighting by adding the correct language name after the first "code fence"
113 |
--------------------------------------------------------------------------------
/ios/ReactAugment/RNAugmentPlayer.m:
--------------------------------------------------------------------------------
1 | //
2 | // AugmentPlayer.m
3 | //
4 | // Copyright © 2017 - Present Augment. All rights reserved.
5 | //
6 |
7 | #import "RNAugmentPlayer.h"
8 | #import "RNAugmentPlayerSDK.h"
9 | #import "RNAugmentReactConstants.h"
10 | #import
11 | #import
12 | #import
13 | #import
14 | #import
15 |
16 | @interface RNAugmentPlayer ()
17 | @property (nonatomic, weak) RCTBridge *bridge;
18 | @property (nonatomic, strong) dispatch_queue_t sessionQueue;
19 |
20 | @property (retain, nonatomic) id augmentPlayer;
21 | @property (nonatomic, weak) AGTView *arView;
22 | @end
23 |
24 | @implementation RNAugmentPlayer
25 |
26 | - (instancetype)initWithBridge:(RCTBridge *)bridge {
27 | if ((self = [super init])) {
28 | self.bridge = bridge;
29 | self.sessionQueue = dispatch_queue_create("sessionQueue", DISPATCH_QUEUE_SERIAL);
30 | self.augmentPlayer = [RNAugmentPlayerSDK.augmentSDK createAugmentPlayer];
31 | AGTView *arView = [AGTView new];
32 | arView.augmentPlayer = self.augmentPlayer;
33 | self.augmentPlayer.modelGestureDelegate = self;
34 | self.augmentPlayer.trackingStatusDelegate = self;
35 | self.arView = arView;
36 | [self addSubview:arView];
37 | [arView setTranslatesAutoresizingMaskIntoConstraints:false];
38 | NSDictionary* viewsDict = @{@"view": arView};
39 | [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[view]-0-|" options:0 metrics:nil views:viewsDict]];
40 | [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[view]-0-|" options:0 metrics:nil views:viewsDict]];
41 | }
42 | return self;
43 | }
44 |
45 | - (void) didMoveToSuperview {
46 | if (self.superview) {
47 | [self startSession];
48 | }
49 | }
50 |
51 | - (void)removeFromSuperview {
52 | _bridge = nil;
53 | _augmentPlayer = nil;
54 | [super removeFromSuperview];
55 | }
56 |
57 | - (void)startSession {
58 | dispatch_async(self.sessionQueue, ^{
59 | /**
60 | * We need to grant camera permission before starting AugmentPlayerSDK
61 | * otherwise we will have an error during initialization: "Cannot access the camera"
62 | * Also we must update our Info.plist to allow camera access on the App level, key: NSCameraUsageDescription
63 | */
64 | AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType: AVMediaTypeVideo];
65 | NSString* errorMessage = @"Augment Player need access to your camera to work.\nGo to Setting and allow access for this App.";
66 | __weak typeof(self) weakSelf = self;
67 | if (authStatus == AVAuthorizationStatusAuthorized) {
68 | [weakSelf startPlayer];
69 | } else if (authStatus == AVAuthorizationStatusNotDetermined) {
70 | [AVCaptureDevice requestAccessForMediaType: AVMediaTypeVideo completionHandler: ^(BOOL granted) {
71 | if (granted) {
72 | [self startPlayer];
73 | }
74 | else {
75 | [weakSelf onInitializationError:nil];
76 | }
77 | }];
78 | } else {
79 | [weakSelf onInitializationError:nil];
80 | }
81 | });
82 | }
83 |
84 | - (void)startPlayer {
85 | __weak typeof(self) weakSelf = self;
86 | dispatch_async(dispatch_get_main_queue(), ^{
87 | NSError *error;
88 | [_augmentPlayer resume:&error];
89 | dispatch_async(self.sessionQueue, ^{
90 | if (error) {
91 | RCTLogError(@"An error occured while starting augmented reality: %@", error.localizedDescription);
92 | [weakSelf onInitializationError:nil];
93 | } else {
94 | [weakSelf onReady:nil];
95 | }
96 | });
97 | });
98 | }
99 |
100 | /**
101 | * This method corresponds to `AugmentReact.addProductToAugmentPlayer`
102 | * data is a Map object that represent a product
103 | * it has "identifier" "brand" "name" and "ean" keys
104 | * This method needs to be called after the success of `AugmentReact.start`
105 | */
106 | - (void) addProduct:(NSDictionary*)product resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter {
107 | [self getProduct:product resolver:resolver rejecter:rejecter];
108 | }
109 |
110 | /**
111 | * This method corresponds to `AugmentReact.recenterProducts`
112 | * This method needs to be called after the success of `AugmentReact.start`
113 | */
114 | - (void) recenterProducts:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter {
115 | [self.augmentPlayer recenterProducts];
116 | resolver(nil);
117 | }
118 |
119 | - (void) takeScreenshot:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter {
120 | [self.augmentPlayer takeScreenshotWithCompletion:^(UIImage * _Nullable screenshotImage) {
121 | if (screenshotImage != NULL) {
122 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
123 | NSString *fileName = [NSString stringWithFormat:@"%@%f.jpg", @"AGT_screenshot_", CFAbsoluteTimeGetCurrent()];
124 | NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent: fileName];
125 | NSData *photoData = UIImageJPEGRepresentation(screenshotImage, 1);
126 | NSError* error;
127 | if ([photoData writeToFile:filePath options:NSDataWritingAtomic error:&error]) {
128 | resolver(filePath);
129 | } else {
130 | rejecter(@"savingScreenshot", [error localizedFailureReason], error);
131 | }
132 | } else {
133 | rejecter(@"ReactAugmentManager", @"Error while taking screenshot", nil);
134 | }
135 | }];
136 | }
137 |
138 | #pragma mark - AR implementation
139 |
140 | /**
141 | * It will get the product from Augment (or from the cache if available)
142 | */
143 | - (void) getProduct:(NSDictionary*)product resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter {
144 |
145 | [self onLoadingProgress: 0];
146 |
147 | // Check if the product is already in cache
148 | id cachedProduct = [RNAugmentPlayerSDK.augmentSDK.productsDataController productForIdentifier: product[@"identifier"]];
149 | if (cachedProduct != nil) {
150 | // Add the product to the AR view
151 | [self addToARView:cachedProduct resolver:resolver rejecter:rejecter];
152 | } else {
153 | // Query Augment Product Database
154 | [self queryAugmentDatabase:product resolver:resolver rejecter:rejecter];
155 | }
156 | }
157 |
158 | - (void) queryAugmentDatabase:(NSDictionary*)product resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter {
159 | __weak typeof(self) weakSelf = self;
160 | [RNAugmentPlayerSDK.augmentSDK.productsDataController checkIfModelDoesExistForProductIdentifier: product[@"identifier"] brand: product[@"brand"] name: product[@"name"] EAN: product[@"ean"] completion: ^(id _Nullable augmentProduct, NSError* _Nullable error) {
161 |
162 | // Check if an error occured
163 | if (error != nil) {
164 | [weakSelf onLoadingOver];
165 | rejecter(@"ReactAugmentManager", error.localizedDescription, error);
166 | return;
167 | }
168 |
169 | // Check if the product is found
170 | if (augmentProduct != nil) {
171 | [weakSelf addToARView:augmentProduct resolver:resolver rejecter:rejecter];
172 | } else {
173 | [weakSelf onLoadingOver];
174 | rejecter(@"ReactAugmentManager", @"This product is not available yet", nil);
175 | }
176 | }];
177 | }
178 |
179 | /**
180 | * Add the Augment-product to the AR View
181 | * In this process the 3D model will be downloaded from the network
182 | * @param augmentProduct AGTProduct The Augment product from the API call
183 | */
184 | - (void) addToARView:(id)augmentProduct resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter {
185 | __weak typeof(self) weakSelf = self;
186 |
187 | /**
188 | * This is used to throttle the number of event sent to React native otherwise it become overloaded
189 | */
190 | __block int lastProgress = 0;
191 | [RNAugmentPlayerSDK.augmentSDK addProduct:augmentProduct toAugmentPlayer:self.augmentPlayer progress:^(NSProgress* _Nonnull progress) {
192 | // Progress callback
193 | int newProgress = (int) round(progress.fractionCompleted * 100);
194 | if (newProgress <= lastProgress) return; // Throttling
195 | lastProgress = newProgress;
196 | dispatch_async(dispatch_get_main_queue(), ^{
197 | [weakSelf onLoadingProgress:newProgress];
198 | });
199 | } completion:^(NSUUID* _Nullable itemIdentifier, NSArray* _Nullable errors) {
200 | // Check for errors
201 | if (errors != nil && errors.count > 0) {
202 | NSMutableString* errorString = [NSMutableString new];
203 | [errors enumerateObjectsUsingBlock: ^(NSError* _Nonnull obj, NSUInteger idx, BOOL* _Nonnull stop) {
204 | [errorString appendString: obj.localizedDescription];
205 | [errorString appendString: @" "];
206 | }];
207 |
208 | [weakSelf onLoadingOver];
209 | rejecter(@"ReactAugmentManager", errorString, nil);
210 | return;
211 | }
212 |
213 | // If everything is ok we start rendering the model
214 | if (itemIdentifier != nil) {
215 | [weakSelf onLoadingOver];
216 | resolver(nil);
217 | } else {
218 | [weakSelf onLoadingOver];
219 | rejecter(@"ReactAugmentManager", @"Impossible to show this product yet", nil);
220 | }
221 | }];
222 | }
223 |
224 | #pragma mark - Events
225 |
226 | - (void)onReady:(NSDictionary *)event {
227 | if (_onPlayerReady) {
228 | _onPlayerReady(event);
229 | }
230 | }
231 |
232 | - (void)onInitializationError:(NSDictionary *)event {
233 | if (_onInitializationFailed) {
234 | _onInitializationFailed(event);
235 | }
236 | }
237 |
238 | - (void) onLoadingProgress: (int) progress {
239 | if (!self.onLoadingProgressDidChange) {
240 | return;
241 | }
242 | self.onLoadingProgressDidChange(@{@"progress": @(progress)});
243 | }
244 |
245 | - (void) onLoadingOver {
246 | if (!self.onLoadingDidFinish) {
247 | return;
248 | }
249 | self.onLoadingDidFinish(nil);
250 | }
251 |
252 | #pragma mark - AGTTrackingStatusDelegate
253 |
254 | - (void)trackStatus:(AGTTrackingStatus)status withErrorMessage:(NSString * _Nullable)errorMessage {
255 | if (_onTrackingStatusChanged) {
256 | _onTrackingStatusChanged(@{
257 | @"status": @(status),
258 | @"message": (errorMessage ?: @"")
259 | });
260 | }
261 | }
262 |
263 | #pragma mark - AGTAugmentPlayerModelGestureDelegate
264 |
265 | - (void)onModelAdded:(NSString * _Nonnull)model3DUuid {
266 | if (_onModelGesture) {
267 | _onModelGesture(@{
268 | @"gesture": @(RNModelGestureEventAdded),
269 | @"model_uuid": model3DUuid
270 | });
271 | }
272 | }
273 |
274 | - (void)onModelRotated:(NSString * _Nonnull)model3DUuid {
275 | if (_onModelGesture) {
276 | _onModelGesture(@{
277 | @"gesture": @(RNModelGestureEventRotated),
278 | @"model_uuid": model3DUuid
279 | });
280 | }
281 | }
282 |
283 | - (void)onModelTranslated:(NSString * _Nonnull)model3DUuid {
284 | if (_onModelGesture) {
285 | _onModelGesture(@{
286 | @"gesture": @(RNModelGestureEventTranslated),
287 | @"model_uuid": model3DUuid
288 | });
289 | }
290 | }
291 |
292 | @end
293 |
--------------------------------------------------------------------------------
/ios/ReactAugment.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 02A578541EB38E18001562F1 /* RNAugmentPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 02A5784E1EB38E18001562F1 /* RNAugmentPlayer.m */; };
11 | 02A578551EB38E18001562F1 /* RNAugmentPlayerSDK.m in Sources */ = {isa = PBXBuildFile; fileRef = 02A578501EB38E18001562F1 /* RNAugmentPlayerSDK.m */; };
12 | 02A578561EB38E18001562F1 /* RNAugmentPlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 02A578521EB38E18001562F1 /* RNAugmentPlayerManager.m */; };
13 | F48D8C2921428EA9001D20C1 /* RNAugmentReactConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F48D8C2821428EA9001D20C1 /* RNAugmentReactConstants.m */; };
14 | /* End PBXBuildFile section */
15 |
16 | /* Begin PBXCopyFilesBuildPhase section */
17 | 02A5783E1EB38DC2001562F1 /* CopyFiles */ = {
18 | isa = PBXCopyFilesBuildPhase;
19 | buildActionMask = 2147483647;
20 | dstPath = "include/$(PRODUCT_NAME)";
21 | dstSubfolderSpec = 16;
22 | files = (
23 | );
24 | runOnlyForDeploymentPostprocessing = 0;
25 | };
26 | /* End PBXCopyFilesBuildPhase section */
27 |
28 | /* Begin PBXFileReference section */
29 | 02A578401EB38DC2001562F1 /* libReactAugment.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactAugment.a; sourceTree = BUILT_PRODUCTS_DIR; };
30 | 02A5784D1EB38E18001562F1 /* RNAugmentPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNAugmentPlayer.h; sourceTree = ""; };
31 | 02A5784E1EB38E18001562F1 /* RNAugmentPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNAugmentPlayer.m; sourceTree = ""; };
32 | 02A5784F1EB38E18001562F1 /* RNAugmentPlayerSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNAugmentPlayerSDK.h; sourceTree = ""; };
33 | 02A578501EB38E18001562F1 /* RNAugmentPlayerSDK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNAugmentPlayerSDK.m; sourceTree = ""; };
34 | 02A578511EB38E18001562F1 /* RNAugmentPlayerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNAugmentPlayerManager.h; sourceTree = ""; };
35 | 02A578521EB38E18001562F1 /* RNAugmentPlayerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNAugmentPlayerManager.m; sourceTree = ""; };
36 | F48D8C2821428EA9001D20C1 /* RNAugmentReactConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNAugmentReactConstants.m; sourceTree = ""; };
37 | F4DDF307214139B100FF47D8 /* AFNetworking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = AFNetworking.framework; path = AFNetworking/AFNetworking.framework; sourceTree = BUILT_PRODUCTS_DIR; };
38 | F4DDF3162141567300FF47D8 /* RNAugmentReactConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNAugmentReactConstants.h; sourceTree = ""; };
39 | /* End PBXFileReference section */
40 |
41 | /* Begin PBXFrameworksBuildPhase section */
42 | 02A5783D1EB38DC2001562F1 /* Frameworks */ = {
43 | isa = PBXFrameworksBuildPhase;
44 | buildActionMask = 2147483647;
45 | files = (
46 | );
47 | runOnlyForDeploymentPostprocessing = 0;
48 | };
49 | /* End PBXFrameworksBuildPhase section */
50 |
51 | /* Begin PBXGroup section */
52 | 02A578371EB38DC2001562F1 = {
53 | isa = PBXGroup;
54 | children = (
55 | 02A578421EB38DC2001562F1 /* ReactAugment */,
56 | 02A578411EB38DC2001562F1 /* Products */,
57 | F4DDF306214139B100FF47D8 /* Frameworks */,
58 | );
59 | sourceTree = "";
60 | };
61 | 02A578411EB38DC2001562F1 /* Products */ = {
62 | isa = PBXGroup;
63 | children = (
64 | 02A578401EB38DC2001562F1 /* libReactAugment.a */,
65 | );
66 | name = Products;
67 | sourceTree = "";
68 | };
69 | 02A578421EB38DC2001562F1 /* ReactAugment */ = {
70 | isa = PBXGroup;
71 | children = (
72 | 02A5784F1EB38E18001562F1 /* RNAugmentPlayerSDK.h */,
73 | 02A578501EB38E18001562F1 /* RNAugmentPlayerSDK.m */,
74 | 02A578511EB38E18001562F1 /* RNAugmentPlayerManager.h */,
75 | 02A578521EB38E18001562F1 /* RNAugmentPlayerManager.m */,
76 | 02A5784D1EB38E18001562F1 /* RNAugmentPlayer.h */,
77 | 02A5784E1EB38E18001562F1 /* RNAugmentPlayer.m */,
78 | F4DDF3162141567300FF47D8 /* RNAugmentReactConstants.h */,
79 | F48D8C2821428EA9001D20C1 /* RNAugmentReactConstants.m */,
80 | );
81 | path = ReactAugment;
82 | sourceTree = "";
83 | };
84 | F4DDF306214139B100FF47D8 /* Frameworks */ = {
85 | isa = PBXGroup;
86 | children = (
87 | F4DDF307214139B100FF47D8 /* AFNetworking.framework */,
88 | );
89 | name = Frameworks;
90 | sourceTree = "";
91 | };
92 | /* End PBXGroup section */
93 |
94 | /* Begin PBXNativeTarget section */
95 | 02A5783F1EB38DC2001562F1 /* ReactAugment */ = {
96 | isa = PBXNativeTarget;
97 | buildConfigurationList = 02A578491EB38DC2001562F1 /* Build configuration list for PBXNativeTarget "ReactAugment" */;
98 | buildPhases = (
99 | 02A5783C1EB38DC2001562F1 /* Sources */,
100 | 02A5783D1EB38DC2001562F1 /* Frameworks */,
101 | 02A5783E1EB38DC2001562F1 /* CopyFiles */,
102 | );
103 | buildRules = (
104 | );
105 | dependencies = (
106 | );
107 | name = ReactAugment;
108 | productName = ReactAugment;
109 | productReference = 02A578401EB38DC2001562F1 /* libReactAugment.a */;
110 | productType = "com.apple.product-type.library.static";
111 | };
112 | /* End PBXNativeTarget section */
113 |
114 | /* Begin PBXProject section */
115 | 02A578381EB38DC2001562F1 /* Project object */ = {
116 | isa = PBXProject;
117 | attributes = {
118 | LastUpgradeCheck = 0820;
119 | ORGANIZATIONNAME = Augment;
120 | TargetAttributes = {
121 | 02A5783F1EB38DC2001562F1 = {
122 | CreatedOnToolsVersion = 8.2.1;
123 | DevelopmentTeam = K464NG3UWC;
124 | ProvisioningStyle = Automatic;
125 | };
126 | };
127 | };
128 | buildConfigurationList = 02A5783B1EB38DC2001562F1 /* Build configuration list for PBXProject "ReactAugment" */;
129 | compatibilityVersion = "Xcode 3.2";
130 | developmentRegion = English;
131 | hasScannedForEncodings = 0;
132 | knownRegions = (
133 | en,
134 | );
135 | mainGroup = 02A578371EB38DC2001562F1;
136 | productRefGroup = 02A578411EB38DC2001562F1 /* Products */;
137 | projectDirPath = "";
138 | projectRoot = "";
139 | targets = (
140 | 02A5783F1EB38DC2001562F1 /* ReactAugment */,
141 | );
142 | };
143 | /* End PBXProject section */
144 |
145 | /* Begin PBXSourcesBuildPhase section */
146 | 02A5783C1EB38DC2001562F1 /* Sources */ = {
147 | isa = PBXSourcesBuildPhase;
148 | buildActionMask = 2147483647;
149 | files = (
150 | 02A578561EB38E18001562F1 /* RNAugmentPlayerManager.m in Sources */,
151 | F48D8C2921428EA9001D20C1 /* RNAugmentReactConstants.m in Sources */,
152 | 02A578541EB38E18001562F1 /* RNAugmentPlayer.m in Sources */,
153 | 02A578551EB38E18001562F1 /* RNAugmentPlayerSDK.m in Sources */,
154 | );
155 | runOnlyForDeploymentPostprocessing = 0;
156 | };
157 | /* End PBXSourcesBuildPhase section */
158 |
159 | /* Begin XCBuildConfiguration section */
160 | 02A578471EB38DC2001562F1 /* Debug */ = {
161 | isa = XCBuildConfiguration;
162 | buildSettings = {
163 | ALWAYS_SEARCH_USER_PATHS = NO;
164 | CLANG_ANALYZER_NONNULL = YES;
165 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
166 | CLANG_CXX_LIBRARY = "libc++";
167 | CLANG_ENABLE_MODULES = YES;
168 | CLANG_ENABLE_OBJC_ARC = YES;
169 | CLANG_WARN_BOOL_CONVERSION = YES;
170 | CLANG_WARN_CONSTANT_CONVERSION = YES;
171 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
172 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
173 | CLANG_WARN_EMPTY_BODY = YES;
174 | CLANG_WARN_ENUM_CONVERSION = YES;
175 | CLANG_WARN_INFINITE_RECURSION = YES;
176 | CLANG_WARN_INT_CONVERSION = YES;
177 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
178 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
179 | CLANG_WARN_UNREACHABLE_CODE = YES;
180 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
181 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
182 | COPY_PHASE_STRIP = NO;
183 | DEBUG_INFORMATION_FORMAT = dwarf;
184 | ENABLE_STRICT_OBJC_MSGSEND = YES;
185 | ENABLE_TESTABILITY = YES;
186 | GCC_C_LANGUAGE_STANDARD = gnu99;
187 | GCC_DYNAMIC_NO_PIC = NO;
188 | GCC_NO_COMMON_BLOCKS = YES;
189 | GCC_OPTIMIZATION_LEVEL = 0;
190 | GCC_PREPROCESSOR_DEFINITIONS = (
191 | "DEBUG=1",
192 | "$(inherited)",
193 | );
194 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
195 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
196 | GCC_WARN_UNDECLARED_SELECTOR = YES;
197 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
198 | GCC_WARN_UNUSED_FUNCTION = YES;
199 | GCC_WARN_UNUSED_VARIABLE = YES;
200 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
201 | MTL_ENABLE_DEBUG_INFO = YES;
202 | ONLY_ACTIVE_ARCH = YES;
203 | SDKROOT = iphoneos;
204 | };
205 | name = Debug;
206 | };
207 | 02A578481EB38DC2001562F1 /* Release */ = {
208 | isa = XCBuildConfiguration;
209 | buildSettings = {
210 | ALWAYS_SEARCH_USER_PATHS = NO;
211 | CLANG_ANALYZER_NONNULL = YES;
212 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
213 | CLANG_CXX_LIBRARY = "libc++";
214 | CLANG_ENABLE_MODULES = YES;
215 | CLANG_ENABLE_OBJC_ARC = YES;
216 | CLANG_WARN_BOOL_CONVERSION = YES;
217 | CLANG_WARN_CONSTANT_CONVERSION = YES;
218 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
219 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
220 | CLANG_WARN_EMPTY_BODY = YES;
221 | CLANG_WARN_ENUM_CONVERSION = YES;
222 | CLANG_WARN_INFINITE_RECURSION = YES;
223 | CLANG_WARN_INT_CONVERSION = YES;
224 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
225 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
226 | CLANG_WARN_UNREACHABLE_CODE = YES;
227 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
228 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
229 | COPY_PHASE_STRIP = NO;
230 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
231 | ENABLE_NS_ASSERTIONS = NO;
232 | ENABLE_STRICT_OBJC_MSGSEND = YES;
233 | GCC_C_LANGUAGE_STANDARD = gnu99;
234 | GCC_NO_COMMON_BLOCKS = YES;
235 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
236 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
237 | GCC_WARN_UNDECLARED_SELECTOR = YES;
238 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
239 | GCC_WARN_UNUSED_FUNCTION = YES;
240 | GCC_WARN_UNUSED_VARIABLE = YES;
241 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
242 | MTL_ENABLE_DEBUG_INFO = NO;
243 | SDKROOT = iphoneos;
244 | VALIDATE_PRODUCT = YES;
245 | };
246 | name = Release;
247 | };
248 | 02A5784A1EB38DC2001562F1 /* Debug */ = {
249 | isa = XCBuildConfiguration;
250 | buildSettings = {
251 | FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../../../ios/Pods/**";
252 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
253 | OTHER_LDFLAGS = "-ObjC";
254 | PRODUCT_NAME = "$(TARGET_NAME)";
255 | SKIP_INSTALL = YES;
256 | };
257 | name = Debug;
258 | };
259 | 02A5784B1EB38DC2001562F1 /* Release */ = {
260 | isa = XCBuildConfiguration;
261 | buildSettings = {
262 | FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../../../ios/Pods/**";
263 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
264 | OTHER_LDFLAGS = "-ObjC";
265 | PRODUCT_NAME = "$(TARGET_NAME)";
266 | SKIP_INSTALL = YES;
267 | };
268 | name = Release;
269 | };
270 | /* End XCBuildConfiguration section */
271 |
272 | /* Begin XCConfigurationList section */
273 | 02A5783B1EB38DC2001562F1 /* Build configuration list for PBXProject "ReactAugment" */ = {
274 | isa = XCConfigurationList;
275 | buildConfigurations = (
276 | 02A578471EB38DC2001562F1 /* Debug */,
277 | 02A578481EB38DC2001562F1 /* Release */,
278 | );
279 | defaultConfigurationIsVisible = 0;
280 | defaultConfigurationName = Release;
281 | };
282 | 02A578491EB38DC2001562F1 /* Build configuration list for PBXNativeTarget "ReactAugment" */ = {
283 | isa = XCConfigurationList;
284 | buildConfigurations = (
285 | 02A5784A1EB38DC2001562F1 /* Debug */,
286 | 02A5784B1EB38DC2001562F1 /* Release */,
287 | );
288 | defaultConfigurationIsVisible = 0;
289 | defaultConfigurationName = Release;
290 | };
291 | /* End XCConfigurationList section */
292 | };
293 | rootObject = 02A578381EB38DC2001562F1 /* Project object */;
294 | }
295 |
--------------------------------------------------------------------------------