Hi folks,
In this post, we will go over how to add an entitlement (capability) to your libGDX iOS game. we assume the app uses robovm to provide the iOS support.
We will assume you want to add Game Center capability to your app.
First, open xcode for a sample project, optionally with the same bundle identifier as your game app
Add the Game Center capability within Xcode by following the instruction here.
Check your provisioning profile to make sure it has the Game Center entitlement
Verify that you can build your sample iOS app using your distribution provisioning profile
If you get an error that the provisioning profile doesn’t contain the Game Centre entitlement, then go to apple developer portal and check the profile there
If the profile has expiration field set to invalid, that means the profile is out of date. click edit button to see the profile details page, then click save. check the profile again to make sure it has a valid expiry date (in the future).
Close and re-open xcode and make sure it fetches the latest provisioning profile
Then check for the entitlements file within your Xcode project. it will be a file with file name ending with .entitlements
Copy the entitlements file into your libgdx ios project. you can call it something like Entitlements.plist.xml
Next you need to configure robovm to add that entitlement. to do this, open your robovm config file (ios/robovm.xml) file and add the following line within the config tag.
<iosEntitlementsPList>Entitlements.plist.xml</iosEntitlementsPList>
That’s it. you can now build your iOS app with robovm resting assured that it has the desired capability.
That’s all for now. Till next time, happy game development.
References
Configuration Reference ยท RoboVM User Guide. http://robovm.mobidevelop.com/docs/en/configuration.html.