How to give a license key in our app, after we purchase the key.

221
4
Jump to solution
03-19-2018 07:26 AM
PhaniBhushankolla
New Contributor

Where should we enter the license key in our app, after we purchase the licensed version.

0 Kudos
1 Solution

Accepted Solutions
DavidLednik
Occasional Contributor II

Oh, I see

Find a location in your code that runs before any ArcGIS Runtime functionality is used. Call the setLicenseKey method on the AGSArcGISRuntimeEnvironment singleton object to license the app with a License key.

In iOS/macOS app that would be in `viewDidLoad` method, right after `super.viewDidLoad()` is called.

regards,

David

View solution in original post

4 Replies
DavidLednik
Occasional Contributor II

Hi!

For detailed licensing information I would recommend our developer pages: License your app—ArcGIS Runtime SDK for iOS | ArcGIS for Developers 

David

PhaniBhushankolla
New Contributor

Hi, I understood the licensing thing, but I am unable to figure out , where we should provide the license key in our code, so that I won't get a pop up to enter my username and password, every time I run the app. 

0 Kudos
DavidLednik
Occasional Contributor II

Oh, I see

Find a location in your code that runs before any ArcGIS Runtime functionality is used. Call the setLicenseKey method on the AGSArcGISRuntimeEnvironment singleton object to license the app with a License key.

In iOS/macOS app that would be in `viewDidLoad` method, right after `super.viewDidLoad()` is called.

regards,

David

View solution in original post

PhaniBhushankolla
New Contributor

Hi David,  

I have set the license in the viewDidLoad method as shown below. Still I am getting the pop to enter my credentials everytime I run my app.

  

    override func viewDidLoad() {

        super.viewDidLoad()

        do

        {

            let result = try?AGSArcGISRuntimeEnvironment.setLicenseKey("

runtimelite,1000,******,none,********")

            print("Registration is \(result?.licenseStatus.rawValue)")

        }

        catch

        {

            print(error)

        }

}

I am getting the response even if I do not enter the credentials, as the license is set and the "Developer Use Only" label is not getting displayed on the map.

0 Kudos