over 11 years ago
Note :- Facebook provides only 25 latest chat conversation messages
/This is completion handler method and takes 3-4 sec to load chat messages from FB/
- [FBRequestConnection startWithGraphPath:@"/me?fields=inbox" completionHandler:^(FBRequestConnection *connection,id user, NSError *error) {
- if (error) {
- //Sorry check permission or network.
- } else {
- //Here we can save conversations into an array and print that array...
- arrConversation = [[user valueForKey:@"inbox"] valueForKey:@"data"];
- NSLog(@"%@", arrConversation);
- }
- }];
- }else{
- [FBSession openActiveSessionWithReadPermissions:arrPermission
- allowLoginUI:YES
- completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
- if (error) {
- //Sorry check permission or network.
- } else {
- NSLog(@"%u", status);
- }
- }];
- }
[FBRequestConnection startWithGraphPath:@"/me?fields=inbox" completionHandler:^(FBRequestConnection *connection,id user, NSError *error) { if (error) { //Sorry check permission or network. } else { //Here we can save conversations into an array and print that array... arrConversation = [[user valueForKey:@"inbox"] valueForKey:@"data"]; NSLog(@"%@", arrConversation); } }]; }else{ [FBSession openActiveSessionWithReadPermissions:arrPermission allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) { if (error) { //Sorry check permission or network. } else { NSLog(@"%u", status); } }]; }
Can you help out the community by solving one of the following Digital Marketing problems?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
0 Comment(s)