We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am unable to login identified user here is my code and it always say Something went wrong
import 'dart:convert'; import 'dart:io'; import 'package:bamboo_connected/src/infrastructure/services/user_singleton.dart'; import 'package:crypto/crypto.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:intercom_flutter/intercom_flutter.dart'; class IntercomService { static Future<void> initialize() async { await Intercom.instance.initialize( '', iosApiKey: '', androidApiKey: '', ); } static Future<void> display() async { await Intercom.instance.displayMessenger(); } static Future<void> sendToken() async { final firebaseMessaging = FirebaseMessaging.instance; final intercomToken = Platform.isIOS ? await firebaseMessaging.getAPNSToken() : await firebaseMessaging.getToken(); await Intercom.instance.sendTokenToIntercom(intercomToken!); } static Future<void> register({ dynamic Function()? onSuccess, dynamic Function(IntercomError)? onFailure, }) async { IntercomStatusCallback? callback; if (onSuccess != null || onFailure != null) { callback = IntercomStatusCallback(onSuccess: onSuccess, onFailure: onFailure); } final user = UserSingleton().user; print(user?.toJson()); final userId = user?.iccId ?? user?.id??''; final secretKey = Platform.isAndroid ? '' : Platform.isIOS ? '' : ''; final key = utf8.encode(secretKey); final bytes = utf8.encode(userId); final hmac = Hmac(sha256, key); final userHash = hmac.convert(bytes).toString(); await Intercom.instance.setUserHash(userHash); await Intercom.instance .loginIdentifiedUser(userId: userId, statusCallback: callback); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am unable to login identified user here is my code and it always say Something went wrong
The text was updated successfully, but these errors were encountered: