Updating User Information

Information

Once you open the permission flow and the user has accepted permissions, our servers will create a user with all the params that you sent to OpenSDK method.

Updating a user

If a user's data is changed in your app, you can update Pngme to maintain consistency using the updateUser method. It's important to know that the method needs to receive all user information again.

void _updateUser() async {
    bool success;
    try {
      success = await platform.invokeMethod("updateUser", <String, dynamic>{
        'companyName': _companyName,
        'userFirstName': _userFirstName,
        'userLastName': _userLastName,
        'userPhone': _userPhone,
        'userEmail': _userEmail,
        'externalId': _externalId,
      });
      _showMyDialog('Update user result', success.toString());
    } catch (e) {
      _showMyDialog('Error on SDK', e.toString());
    }
    print(success);
  }

πŸ“˜

Information

The updateUser method should only be called after the user has granted permissions and accepted the terms and conditions.

❗️

Warning

You cannot modify userPhone, otherwise the SDK will create and register a new user and will not change the anything on the existing user.