Skip to content

Commit

Permalink
Merge branch 'develop' into Feature-AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Thivesshj committed Sep 29, 2022
2 parents a4ab4ca + 86215e1 commit 5966d39
Show file tree
Hide file tree
Showing 49 changed files with 547 additions and 1,239 deletions.
1 change: 1 addition & 0 deletions front-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@capacitor/ios": "4.2.0",
"@capacitor/keyboard": "1.2.2",
"@capacitor/push-notifications": "^4.1.0",
"@capacitor/app-launcher": "^4.0.1",
"@capacitor/status-bar": "1.0.8",
"@teamhive/capacitor-video-recorder": "^5.0.0",
"@tensorflow/tfjs": "^3.20.0",
Expand Down
26 changes: 14 additions & 12 deletions front-end/src/components/AR/AR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import {IonButton, IonToast} from '@ionic/react';
import React, { useState } from "react";
import './AR.css';
import { Device } from '@capacitor/device';
import compList from './compatibleDevices'
import { AppLauncher } from '@capacitor/app-launcher';

/**
* @brief input inteface for IonToast
Expand Down Expand Up @@ -110,18 +109,20 @@ const AR: React.FC<ARInputProps> = ( inp ) => {
* @returns boolean
*/
const IsAndroid = async () =>{
return await isCompatible();
}

const isCompatible= async () =>{
const info = await Device.getInfo();
console.log(info.model);
if(compList.indexOf(info.model)>=0)
let app:string = 'com.google.ar.core'

const { value } = await AppLauncher.canOpenUrl({ url: app });
if(value===true) {
console.log(app + ' is available')
return true
else
}
else {
console.log(app + ' is NOT available')
return false

}
}



//=========================================================================================================//
/**
Expand Down Expand Up @@ -158,7 +159,8 @@ const AR: React.FC<ARInputProps> = ( inp ) => {
href+="end;";

// launch intent
window.location.replace(href) ;

await AppLauncher.openUrl({ url: href});
console.log("isAndroid:" + href);

}
Expand Down
Loading

0 comments on commit 5966d39

Please sign in to comment.