Here are a few of the more common issues that customers have run into when integrating the Apptentive iOS SDK in their app.
This is probably the most common issue customers encounter. There are a few reasons why this could be happening:
-engage:fromViewController:method isn't able to present UI: In version 3.2.0 and later of the SDK, you will see an error in the console when this happens ("Attempting to present interaction on a view controller whose view is not visible in a window."). This can happen for several reasons:
-engage:fromViewController:method is called in
-engage:fromViewController:method receives a view controller that is in the process of being dismissed or obscured. If you want to engage an event after dismissing a view controller, call
-engage:fromViewController:in the completion block of
-dismissViewControllerAnimated:completion:and pass in your view controller's
presentingViewControllerproperty. Likewise, use the completion block of
-presentViewController:animated:completion:to engage an event after presenting a view controller, passing in the newly-presented view controller.
In order to allow Message Center to be configured from the Apptentive dashboard, the SDK has to download the configuration from our API at least once before Message Center can be presented. This normally happens within 15 to 30 seconds of launching the app for the first time. By default, the SDK will log a message to the console indicating when the configuration has loaded ("Received remote Interactions from Apptentive.").
Before the configuration is loaded, users who launch Message Center will see a message explaining that it is not yet available ("We’re attempting to connect. Thanks for your patience!"). In real-world use it is unlikely that a user would encounter this, as they would have to seek out the Message Center feature within a few seconds of launching your app for the first time. However it is quite likely that you will encounter this when testing your app, so please wait for the configuration to load before launching Message Center.
Occasionally when our API is experiencing a period of unusually heavy load, it may take longer than the typical 15 to 30 seconds for the configuration to download. If you are seeing HTTP errors (specifically error number 502) in the console, or it is taking longer than a minute for the "Received remote Interactions from Apptentive" message to appear, please check our Apptentive Status twitter account for updates. In this case the Apptentive SDK will retry sending event, message, and survey data until it is successfully transmitted.
The image attachment button may be hidden for one of two reasons:
NSPhotoLibraryUsageDescriptionkey ("Privacy - Photo Library Usage Description") in its
Info.plistfile. iOS 10 and later requires a usage description for apps that wish to access the user's photo library.
By default, the
barTintColor property of the navigation bars in the Apptentive UI is set to white. If your status bar text and icons, your navigation bar title text color, or your bar button items' tint color is set to white as well, they will appear invisible. In that case you should make sure to set a contrasting bar tint color as described in the customization guide.
When updating the SDK from a prior version, occasionally the resource bundle can get out of sync with the SDK or vice versa. It may be helpful to remove files from Xcode's Derived Data directory, as the Clean and Clean Build Folder options don't always completely clear the appropriate caches:
rm -fr ~/Library/Developer/Xcode/DerivedData/*