Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sup 7038 #321

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
5 changes: 2 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ In this file we share a way to upgrade previous versions of react-native-situm-p
```js
// your imports

const SITUM_EMAIL = "YOUR_EMAIL_HERE";
const SITUM_API_KEY = "YOUR_APIKEY_HERE";
const SITUM_BUILDING_ID = "YOUR_BUILDING_ID_HERE";
const BUILDING_IDENTIFIER = "YOUR_BUILDING_IDENTIFIER_HERE";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En otros repos no se añade el _HERE del final, lo dejaría igual en todos


const App: React.FC = () => {
return (
<View>
<SitumProvider email={SITUM_EMAIL} apiKey={SITUM_API_KEY}>
<MapView
buildingId={SITUM_BUILDING_ID}
buildingId={BUILDING_IDENTIFIER}
// other props
/>
</SitumProvider>
Expand Down
7 changes: 2 additions & 5 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,13 @@ pod install
### Step 2: Set your credentials <a name="config"/>

For this step you must create a situm account, so [setup your account](../README.md#setup-your-account) before continuing.
After creating your situm account, you can set your credentials on the properties of [`src/situm.tsx`](./src/situm.tsx), like so:
After creating your situm account, you can set your [credentials](https://situm.com/docs/built-in-wayfinding-ui/#prepare-viewer) on the properties of [`src/situm.tsx`](./src/situm.tsx), like so:

```js
export const SITUM_EMAIL = '';
export const SITUM_API_KEY = '';
export const SITUM_BUILDING_ID = ''; // Identifier of the building
export const SITUM_DASHBOARD_URL = 'https://dashboard.situm.com';
export const BUILDING_IDENTIFIER = '';
```

**NOTE**: You should also fill the [SITUM_BUILDING_ID](https://situm.com/docs/sdk-cartography/#building-identifier) and [SITUM_FLOOR_ID](https://situm.com/docs/sdk-cartography/#floor-identifier) variables so all the examples are able to work as expected. In case you haven't created POIs or paths yet, learn [how to create these cartography elements](https://situm.com/docs/sdk-cartography/#sdk-a-basic-complete-cartography-example).

### Step 3: Run the app <a name="runapplication"></a>

Expand Down
2 changes: 1 addition & 1 deletion example/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ parameters:
default: "1"
- name: FLOORID
type: string
default: "1"
emmanueltd marked this conversation as resolved.
Show resolved Hide resolved
default: "1"
- name: DASHBOARD_URL
type: string
default: "https://dashboard.situm.com"
Expand Down
8 changes: 3 additions & 5 deletions example/azure/common-steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
- name: BUILDINGID
type: string
- name: FLOORID
type: string
type: string
- name: DASHBOARD_URL
type: string
- name: BUILDNUMBER
Expand Down Expand Up @@ -55,10 +55,8 @@ steps:
echo -e "\t[+] BUILDNUMBER: ${{ parameters.BUILDNUMBER }}"
echo -e "\t[+] Plugin Version used: $pluginVersion"

echo "export const SITUM_EMAIL = '${{ parameters.XAPIEMAIL }}';" > example/src/situm.tsx
echo "export const SITUM_API_KEY = '${{ parameters.XAPIKEY }}';" >> example/src/situm.tsx
echo "export const SITUM_BUILDING_ID = '${{ parameters.BUILDINGID }}';" >> example/src/situm.tsx
echo "export const SITUM_FLOOR_ID = '${{ parameters.FLOORID }}';" >> example/src/situm.tsx
emmanueltd marked this conversation as resolved.
Show resolved Hide resolved
echo "export const SITUM_API_KEY = '${{ parameters.XAPIKEY }}';" > example/src/situm.tsx
echo "export const BUILDING_IDENTIFIER = '${{ parameters.BUILDINGID }}';" >> example/src/situm.tsx
echo "export const SITUM_DASHBOARD_URL = '${{ parameters.DASHBOARD_URL }}';" >> example/src/situm.tsx

displayName: Configure credentials
6 changes: 3 additions & 3 deletions example/src/examples/sdk/BuildingFullInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {ScrollView} from 'react-native';
import SitumPlugin from '@situm/react-native';
import type {Building, Floor, Poi} from '@situm/react-native';

import {SITUM_BUILDING_ID} from '../../situm';
import {BUILDING_IDENTIFIER} from '../../situm';
import styles from '../styles/styles';
import {fetchBuilding} from '../Utils/CommonFetchs';
import {Card, Text} from 'react-native-paper';
Expand Down Expand Up @@ -41,7 +41,7 @@ export const BuildingFullInfo = () => {
};

useEffect(() => {
fetchBuilding(SITUM_BUILDING_ID)
fetchBuilding(BUILDING_IDENTIFIER)
.then(setBuilding)
.catch(error => {
console.error(`Situm > example > Failed to fetch building: ${error}`);
Expand All @@ -56,7 +56,7 @@ export const BuildingFullInfo = () => {

return (
<ScrollView style={{...styles.screenWrapper}}>
{!SITUM_BUILDING_ID && (
{!BUILDING_IDENTIFIER && (
<Text>No building id provided, please edit your situm.tsx file</Text>
)}
<Card mode="contained" style={styles.margin}>
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/sdk/InfoFromBuilding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
import {Text, ScrollView} from 'react-native';

import SitumPlugin, {BuildingInfo} from '@situm/react-native';
import {SITUM_BUILDING_ID} from '../../situm';
import {BUILDING_IDENTIFIER} from '../../situm';
import styles from '../styles/styles';
import {fetchBuilding} from '../Utils/CommonFetchs';
import {Card} from 'react-native-paper';
Expand All @@ -23,7 +23,7 @@ export const InfoFromBuilding = () => {
};

useEffect(() => {
fetchBuilding(SITUM_BUILDING_ID)
fetchBuilding(BUILDING_IDENTIFIER)
.then(myBuilding => getInfoFromBuilding(myBuilding))
.catch(e => {
console.error(`Situm > example > Could not fetch building: ${e}`);
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/sdk/RouteBetweenPOIs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
import {ScrollView, Text} from 'react-native';
import SitumPlugin, {Building, Poi} from '@situm/react-native';

import {SITUM_BUILDING_ID} from '../../situm';
import {BUILDING_IDENTIFIER} from '../../situm';
import styles from '../styles/styles';
import {fetchBuilding} from '../Utils/CommonFetchs';
import {Card} from 'react-native-paper';
Expand Down Expand Up @@ -51,7 +51,7 @@ export const RouteBetweenPOIs = () => {

useEffect(() => {
// first load the building
fetchBuilding(SITUM_BUILDING_ID)
fetchBuilding(BUILDING_IDENTIFIER)
.then(setBuilding)
.catch(e => {
console.error(`Situm > example > Coult not fetch building ${e}`);
Expand Down
11 changes: 9 additions & 2 deletions example/src/examples/wayfinding/NavigateToPoi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import SitumPlugin, {
requestPermission,
} from '@situm/react-native';
import type {MapViewRef} from '@situm/react-native';
import {SITUM_API_KEY, SITUM_BUILDING_ID} from '../../situm';
import {
SITUM_API_KEY,
BUILDING_IDENTIFIER,
LANGUAGE,
REMOTE_IDENTIFIER,
} from '../../situm';
import {Button, TextInput} from 'react-native-paper';

const styles = StyleSheet.create({
Expand Down Expand Up @@ -88,8 +93,10 @@ const Screen: React.FC = () => {
<MapView
ref={mapViewRef}
configuration={{
buildingIdentifier: SITUM_BUILDING_ID,
buildingIdentifier: BUILDING_IDENTIFIER,
situmApiKey: SITUM_API_KEY,
remoteIdentifier: REMOTE_IDENTIFIER,
language: LANGUAGE,
}}
onPoiSelected={evt => {
setSelectedPoiIdentifier(evt?.identifier.toString());
Expand Down
11 changes: 9 additions & 2 deletions example/src/examples/wayfinding/SelectPoi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import SitumPlugin, {
requestPermission,
} from '@situm/react-native';
import type {MapViewRef} from '@situm/react-native';
import {SITUM_API_KEY, SITUM_BUILDING_ID} from '../../situm';
import {
SITUM_API_KEY,
BUILDING_IDENTIFIER,
LANGUAGE,
REMOTE_IDENTIFIER,
} from '../../situm';
import {Button, TextInput} from 'react-native-paper';

const styles = StyleSheet.create({
Expand Down Expand Up @@ -88,8 +93,10 @@ const Screen: React.FC = () => {
<MapView
ref={mapViewRef}
configuration={{
buildingIdentifier: SITUM_BUILDING_ID,
buildingIdentifier: BUILDING_IDENTIFIER,
situmApiKey: SITUM_API_KEY,
remoteIdentifier: REMOTE_IDENTIFIER,
language: LANGUAGE,
}}
/>
</SafeAreaView>
Expand Down
11 changes: 9 additions & 2 deletions example/src/examples/wayfinding/SelectPoiCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import SitumPlugin, {
requestPermission,
} from '@situm/react-native';
import type {MapViewRef} from '@situm/react-native';
import {SITUM_API_KEY, SITUM_BUILDING_ID} from '../../situm';
import {
SITUM_API_KEY,
BUILDING_IDENTIFIER,
LANGUAGE,
REMOTE_IDENTIFIER,
} from '../../situm';
import {Button, TextInput} from 'react-native-paper';

const styles = StyleSheet.create({
Expand Down Expand Up @@ -90,8 +95,10 @@ const Screen: React.FC = () => {
<MapView
ref={mapViewRef}
configuration={{
buildingIdentifier: SITUM_BUILDING_ID,
buildingIdentifier: BUILDING_IDENTIFIER,
situmApiKey: SITUM_API_KEY,
remoteIdentifier: REMOTE_IDENTIFIER,
language: LANGUAGE,
}}
/>
</SafeAreaView>
Expand Down
11 changes: 9 additions & 2 deletions example/src/examples/wayfinding/SetFavoritePois.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import SitumPlugin, {
} from '@situm/react-native';
import type {MapViewRef} from '@situm/react-native';
import type {OnFavoritePoisUpdatedResult} from '@situm/react-native';
import {SITUM_API_KEY, SITUM_BUILDING_ID} from '../../situm';
import {
SITUM_API_KEY,
BUILDING_IDENTIFIER,
LANGUAGE,
REMOTE_IDENTIFIER,
} from '../../situm';
import {Button, TextInput} from 'react-native-paper';

const styles = StyleSheet.create({
Expand Down Expand Up @@ -104,8 +109,10 @@ const Screen: React.FC = () => {
ref={mapViewRef}
onFavoritePoisUpdated={onFavoritePoisUpdated}
configuration={{
buildingIdentifier: SITUM_BUILDING_ID,
buildingIdentifier: BUILDING_IDENTIFIER,
situmApiKey: SITUM_API_KEY,
remoteIdentifier: REMOTE_IDENTIFIER,
language: LANGUAGE,
}}
/>
</SafeAreaView>
Expand Down
11 changes: 9 additions & 2 deletions example/src/examples/wayfinding/Wayfinding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ import type {
OnExternalLinkClickedResult,
MapViewRef,
} from '@situm/react-native';
import {SITUM_API_KEY, SITUM_BUILDING_ID} from '../../situm';
import {
SITUM_API_KEY,
BUILDING_IDENTIFIER,
LANGUAGE,
REMOTE_IDENTIFIER,
} from '../../situm';

const styles = StyleSheet.create({
container: {
Expand Down Expand Up @@ -137,8 +142,10 @@ const Screen: React.FC = () => {
<MapView
ref={mapViewRef}
configuration={{
buildingIdentifier: SITUM_BUILDING_ID,
buildingIdentifier: BUILDING_IDENTIFIER,
situmApiKey: SITUM_API_KEY,
remoteIdentifier: REMOTE_IDENTIFIER,
language: LANGUAGE,
}}
onLoad={onLoad}
onPoiSelected={onPoiSelected}
Expand Down
26 changes: 22 additions & 4 deletions example/src/situm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
export const SITUM_API_KEY = '';
export const SITUM_BUILDING_ID = ''; // Identifier of the building
export const SITUM_FLOOR_ID = ''; // Identifier of the floor
export const SITUM_DASHBOARD_URL = 'https://dashboard.situm.com';
// Your Situm API Key (positioning).
export const SITUM_API_KEY = 'YOUR-SITUM-API-KEY';

// Set here the building identifier you want on the map.
export const BUILDING_IDENTIFIER = 'YOUR-BUILDING-IDENTIFIER';

// Alternatively, you can set an identifier that allows you to remotely configure all map settings.
//For now, you need to contact Situm to obtain yours.
emmanueltd marked this conversation as resolved.
Show resolved Hide resolved
export const REMOTE_IDENTIFIER = '';

// You can also specify the language in which you want the UX of the viewer to be displayed.
export const LANGUAGE = '';

// A String parameter that allows you to specify which domain will be displayed inside our webview.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lo mismo que puse en la otra, falta un ejemplo de como sería este código

export const API_DOMAIN = 'https://dashboard.situm.com';

// Supporting documentation
`
╔═══════════════════════════════════════════════════════════════════════════════════════════╗
║ Visit https://situm.com/docs/built-in-wayfinding-ui/#prepare-viewer for more information. ║
╚═══════════════════════════════════════════════════════════════════════════════════════════╝
`;
2 changes: 1 addition & 1 deletion src/wayfinding/components/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const MapView = React.forwardRef<MapViewRef, MapViewProps>(
* <MapView
* ref={(ref: MapViewRef) => ref.selectPoi(122)}
* configuration={{
* buildingIdentifier: SITUM_BUILDING_ID,
* buildingIdentifier: BUILDING_IDENTIFIER,
* }}
* onLoad={onLoad} />
*/
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9531,4 +9531,4 @@ [email protected]:
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigue habiendo un cambio en el yarn.lock al parecer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.