We constantly publish updates to our documentation, which may not yet be available in your language. For the most current information, use the English version.
if (Platform.isIOS){
Adjust.requestTrackingAuthorizationWithCompletionHandler().then((status) {
switch (status) {
case 0:
// ATTrackingManagerAuthorizationStatusNotDetermined case
break;
case 1:
// ATTrackingManagerAuthorizationStatusRestricted case
break;
case 2:
// ATTrackingManagerAuthorizationStatusDenied case
break;
case 3:
// ATTrackingManagerAuthorizationStatusAuthorized case
break;
}
});
}
// main.dart
import 'package:adjust_sdk/adjust.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
initPlatformState() async {
AdjustConfig config =
new AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
config.logLevel = AdjustLogLevel.verbose;
Adjust.requestTrackingAuthorizationWithCompletionHandler().then((status) {
print('[Adjust]: Authorization status update!');
switch (status) {
case 0:
print(
'The user has not responded to the access prompt yet.');
break;
case 1:
print(
'Access to app-related data is blocked at the device level.');
break;
case 2:
print(
'The user has denied access to app-related data for device tracking.');
break;
case 3:
print(
'The user has approved access to app-related data for device tracking.');
break;
}
});
Adjust.start(config);
}