This method triggers the installation of a Passpoint Wi-Fi profile in the device.
/**
* Add or update HotSpot 2.0 Wi-Fi profile
*
* @param username - authorization user name
* @param password - authorization password
*
* @throws Exception - exception thrown if profile cannot be created or updated
*/
@TargetApi(Build.VERSION_CODES.O)
public Future<Boolean> createPasspointProfile(String username, String password,
Callback<Boolean> onSuccess,
Callback<MobileSDKException> onError) {
return asyncExecutor.execute(() -> wiFiProfileService.createPasspointProfile(username, password), onSuccess, onError);
}
Passpoint is supported in Android 11+.
We suggest to fallback to WPA2 enterprise if the device doens't support Passpoint using the following snippet.
if(cloud4wiSDK.isPasspointSupported()) {
cloud4wiSDK.createPasspointProfile(username, password)
} else {
// Android 10- and other devices that don't support Passpoint
cloud4wiSDK.createWPA2EnterpriseProfile(username, password)
}