Updating User Information

Introduction

Once you open the permission flow and the user accepts the permission, our servers will create a user with all the params that you sent to SmsPngmeAndroid 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.

import SmsPngmeAndroid, {
  updateUser,
} from '@pngme/react-native-sms-pngme-android'; 

const handleUpdateUser = async () => {
  const permissionFlowState = await updateUser({
    companyName: 'My Company',
    userFirstName: 'Updated Test Name',
    userLastName: 'Updated Test Lastname',
    userPhone: '233454456',
    userEmail: '[email protected]',
    externalId: 'your uuid hash',
  });
  Alert.alert('Update user', `Success: ${permissionFlowState.toString()}`);
};

📘

Information

The updateUser method should be called after the user has granted permissions and has accepted 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.


Did this page help you?