Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intercom.instance.updateUser() breaks Intercom Messenger #479

Open
chrallard opened this issue Nov 4, 2024 · 0 comments
Open

Intercom.instance.updateUser() breaks Intercom Messenger #479

chrallard opened this issue Nov 4, 2024 · 0 comments

Comments

@chrallard
Copy link

chrallard commented Nov 4, 2024

Platform: Web
Flutter: 3.19.6
intercom_flutter: ^9.0.1

I get the following error whenever I call Intercom.instance.updateUser().

Intercom Messenger error: Missing user_hash. 
A valid user_hash is required to authenticate users when Identity Verification is enabled. 
For more details, see https://docs.intercom.com/configure-intercom-for-your-product-or-site/staying-secure/enable-identity-verification-on-your-web-product.

Now Intercom.instance.displayMessenger() no longer opens.
I am successfully setting the user hash via Intercom.instance.setUserHash() before attempting to update the user.

Reproducible example:
I've removed any sensitive data.

void main() {
  runApp(const MyApp());
  Intercom.instance.initialize(
    'insert_key_here',
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Intercom Example')),
        body: Center(
          child: Row(
            children: [
              ElevatedButton(
                onPressed: () {
                  Intercom.instance.setUserHash(
                    'insert_hash_here',
                  );
                },
                child: const Text('Hash'),
              ),
              ElevatedButton(
                onPressed: () {
                  Intercom.instance.loginIdentifiedUser(
                    userId: 'insert_user_id',
                  );
                },
                child: const Text('Log in'),
              ),
              ElevatedButton(
                onPressed: () {
                  Intercom.instance.updateUser(
                    email: '_',
                    name: '_',
                    phone: '_',
                    userId: '_',
                    company: '_',
                    companyId: '_',
                  );
                },
                child: const Text('Update user'),
              ),
              ElevatedButton(
                onPressed: () {
                  Intercom.instance.logout();
                },
                child: const Text('Log out'),
              ),
              ElevatedButton(
                onPressed: () {
                  Intercom.instance.displayMessenger();
                },
                child: const Text('Open Intercom Messenger'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant