Cordova plugin for using Navitia SDK iOS & Android
This plugin uses native SDKs. Since those SDKs are private, you will need to get access credentials to our artifactory. This plugin uses Cocoapods to manage dependencies for iOS, please install it first: https://cocoapods.org.
Once you have credentials to access our artifactory, one further step is required before installing the plugin. Please follow one of these steps to configure the credentials properly.
The <YOUR_ARTIFACTORY_USERNAME>
and <YOUR_ARTIFACTORY_PASSWORD>
should be replaced with your username and password!
In the Config.xml file of your project, add these lines:
<widget>
.
.
<preference name="KISIO_ARTIFACTORY_USERNAME" value="<YOUR_ARTIFACTORY_USERNAME>" />
<preference name="KISIO_ARTIFACTORY_PASSWORD" value="<YOUR_ARTIFACTORY_PASSWORD>" />
</widget>
Define two global environment variables as follows:
KISIO_ARTIFACTORY_USERNAME=<YOUR_ARTIFACTORY_USERNAME>
KISIO_ARTIFACTORY_PASSWORD=<YOUR_ARTIFACTORY_PASSWORD>
In the Home directory, open .netrc
file (if not found, create a new file) and add this line:
machine kisiodigital.jfrog.io login <YOUR_ARTIFACTORY_USERNAME> password <YOUR_ARTIFACTORY_PASSWORD>
In the ~/.gradle
directory, open gradle.properties
file (if not found, create a new file) andd these lines:
kisio_artifactory_username=<YOUR_ARTIFACTORY_USERNAME>
kisio_artifactory_password=<YOUR_ARTIFACTORY_PASSWORD>
Use this command to install the plugin cordova plugin add cordova-plugin-navitia-sdk
NavitiaSDK.init('my-token', function() {}, function(error) {
console.log(error);
});
NavitiaSDK.places.placesRequestBuilder().withQ('gare').get(function(success) {
alert(success.places);
}, function(error) {
alert("An error has occured");
});