Common Issues
The issues below are the ones developers usually meet first. For anything else, see the complete troubleshooting guides in AIDE Docs.
"AFCore has not been initialized"
A feature such as AFCore.activities() was used before AFCore.initialize() ran. Call initialize() once, at app start (Application.onCreate() on Android, your app's init or application(_:didFinishLaunchingWithOptions:) on iOS), before anything else uses AFCore. Where code can run earlier, check AFCore.isInitialized() first. On iOS, a feature reached before initialization ends the app, so the check matters there. See Initialization.
The member is signed out after a second initialize()
Calling initialize() again with a different configuration resets the SDK and, with a different base URL or realm, ends the member's session. Initialize once; to change the configuration on purpose, call reconfigure().
A permission prompt never appears
- Android: call
AFPermissions.registerLifecycle(activity)in your activity'sonCreate()so AFCore can show the system prompts. - iOS: add the location, motion and health usage descriptions your app needs to
Info.plist; without them the system shows no prompt. See iOS installation. - Background location: ask for location first and for background ("Always") location afterwards. A member who declined can only change it in the system settings: offer
AFPermissions.openAppSettings().
See Runtime Permissions.
A member does not see any data
- The capability is not offered. Premium features need the capability on your client and in the member's program. Check
AFCore.programs().getAvailablePrograms()before showing a feature. - The read failed but looked empty. By default some reads return an empty result when the request fails. Set
throwOnReadFailure(true)onAFCoreConfig.Builderto get an error instead, so your app can show Retry. This is recommended for new integrations. - Steps are missing. Steps appear only after SmartWalking is connected and a sync has been processed.
AFCore.smartWalking().getDiagnostics()summarizes the connection, permissions and last sync. - Visits are missing. Automatic visits need background location access, the member's gym saved as a favorite and visit detection started after sign-in. Signing out stops visit detection.
Location Services are turned off
With the device's Location Services off, no app receives location, so visit detection reports LOCATION_SERVICES_DISABLED and the map cannot center on the member. Check AFCore.locations().areLocationServicesEnabled() and offer AFCore.locations().openLocationSettings().
More help
- FAQ -- short answers to frequent questions.
- API Reference -- every call and model.
- Complete troubleshooting guides are in AIDE Docs.