├── 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 | [![npm version](https://badge.fury.io/js/react-native-augment.svg)](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 |