addUser method

  1. @override
Future<IAMPASSUser?> addUser(
  1. String user,
  2. String notificationToken
)
override

Implementation

@override
Future<IAMPASSUser?> addUser(String user, String notificationToken) async {
  Map<String, String> args = {
    "userID": user,
    "notificationToken": notificationToken
  };

  final result = await methodChannel.invokeMethod<String>('AddUser', args);

  if (result != null) {
    Map<String, dynamic> map = jsonDecode(result);

    final IAMPASSUser trainedUser = IAMPASSUser.fromJson(map);
    return trainedUser;
  }

  return null;
}