techaffinity / freshchat-phonegap

Freshchat sdk for phonegap
7 stars 36 forks source link

getRestoreID for phonegap is not returning anything. can you help me ? #29

Open rakeshorbonix opened 5 years ago

rakeshorbonix commented 5 years ago

getRestoreID for phonegap is not returning anything. can you help me ? showSupportChat = function() { //console.log("showsupportchat"); // (window as any).Freshchat.clearUserData(); var details = JSON.parse(window.localStorage.getItem("user_detail")); //console.log(details['uid']); (window as any).Freshchat.updateUser({ "firstName" : "Hello", "lastName" : "", "email" : "test@gmail.com", "countryCode" : "+91", "externalId": "12345678", }); alert((window as any).Freshchat.getRestoreId());

// var getRestoreID = "hello"; // (window as any).Freshchat.getRestoreID({ // getRestoreID = (window as any).Freshchat.getUser().getRestoreId(); // }); // // console.log(getRestoreID); //(window as any).Freshchat.setExternalID("12345678"); //(window as any).Freshchat.setRestoreID("12345678");

(window as any).Freshchat.showConversations(); (window as any).Freshchat.identifyUser("12345678", null); var restoreId = (window as any).Freshchat.getUser().getRestoreId();

};

I am using this in ionic 3 . But "(window as any).Freshchat.getRestoreId()" is returning nothing.

techaffinity commented 5 years ago

We are looking into this and will keep you updated.

VOBRT commented 5 years ago

Hi @rakeshorbonix

Is the code you mentioned previously for "Freshchat.updateUser" working for you?

(window as any).Freshchat.updateUser({ "firstName" : "Hello", "lastName" : "", "email" : "test@gmail.com", "countryCode" : "+91", "externalId": "12345678", });

shagulameedn commented 5 years ago

Update user info. Accepts a JSON with the following format { "firstName" : "John", "lastName" : "Doe" "email" : "johndoe@dead.man", "countryCode" : "+91", "phoneNumber" : "1234234123" }

mredbishop commented 5 years ago

Can I check that getRestoreId is the function that should be called to restore chats from other devices?

Ed

techaffinity commented 5 years ago

We have update the Restore Id listener. Please refer this README docs for Restore Id.