Select to view content in your preferred language

routing services and credentials

1586
7
Jump to solution
02-15-2021 06:01 PM
EricAtkinson1
Regular Contributor

Hi all,

I'm having some issues with routing and wondering how I add my API key for routing into the App? I have tried to put the API key as a credential but get...

MyApp.qml:292: ReferenceError: .... is not defined /

 

RouteTask {
id: routeTask
url: "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer"
credential:

I have registered the app and have a clientID and also clientSecret also.

Any help would be appreciated.

 

Eric

0 Kudos
2 Solutions

Accepted Solutions
ErwinSoekianto
Esri Alum

Eric, 

 

The API Key is supported in ArcGIS Runtime SDK 100.10 which included in the AppStudio 5.0 Beta, that is available to download from Early Adopter Community. It is planned to be released in March/April 2021. 

 

For the current production of AppStudio 4.4, you can still use Client ID and Client Secret, you can see this on one of our samples, Nearby sample, Views/RouteView.qml line 289. see attached code. 

 

Thank you,

Erwin

 

View solution in original post

0 Kudos
EricAtkinson1
Regular Contributor

Thanks for that, for some reason it doesn't seem to be working. It now comes up with the following error for both lines "Unable to assign [undefined] to QString" 

                clientId: app.clientId
                clientSecret: app.clientSecret

I have assigned the app a client ID and also Client secret and also checked on the developers dashboard.

 

Thanks for your help.

 

Eric

View solution in original post

0 Kudos
7 Replies
ErwinSoekianto
Esri Alum

Eric, 

 

The API Key is supported in ArcGIS Runtime SDK 100.10 which included in the AppStudio 5.0 Beta, that is available to download from Early Adopter Community. It is planned to be released in March/April 2021. 

 

For the current production of AppStudio 4.4, you can still use Client ID and Client Secret, you can see this on one of our samples, Nearby sample, Views/RouteView.qml line 289. see attached code. 

 

Thank you,

Erwin

 

0 Kudos
EricAtkinson1
Regular Contributor

Thanks for that, for some reason it doesn't seem to be working. It now comes up with the following error for both lines "Unable to assign [undefined] to QString" 

                clientId: app.clientId
                clientSecret: app.clientSecret

I have assigned the app a client ID and also Client secret and also checked on the developers dashboard.

 

Thanks for your help.

 

Eric

0 Kudos
ErwinSoekianto
Esri Alum

@EricAtkinson1 

 

Can you first try that the clientid and clientsecret are working on the Nearby sample? 

 

Erwin

0 Kudos
EricAtkinson1
Regular Contributor

Hi Erwin,

This is another question but something I saw you covered in a Youtube video and its about external link to Google Maps. Just to confirm that when using ArcGIS player there is no way for it to externally load up google maps app? e.g, ios ArcGIS player loading Google maps?

Cheers,

 

Eric

0 Kudos
ErwinSoekianto
Esri Alum

@EricAtkinson1 

 

No, you would not be able to load Google Map App inside the AppStudio Player, however I think you can open a WebView of that would open the Google Map URL with the destination pre-configured in the URL. 

0 Kudos
EricAtkinson1
Regular Contributor

Yes it works in nearby, the only way I could get it to work is to insert it into the code like this

id: clientInfo
 
        clientId: "Client ID inserted"
        clientSecret: "secret code inserted"
        oAuthMode: Enums.OAuthModeApp

 

When I try it outside of nearby app it doesn't seem to work or even provide any kind of error while debugging.

Cheers,

 

Eric

Cheers,

 

Eric  

0 Kudos
EricAtkinson1
Regular Contributor

All sorted issue with my URL..... Fat fingers 

0 Kudos