Posted By

TenDegrees on 12/09/15


Tagged

Unity invite TenDegrees


Versions (?)

Responding to an Invite


 / Published in: Objective C
 

The process required for accepting or rejecting an invite within Unity.

  1. Invite *inviteToRespondTo = yourContactInvite;
  2. [self respondToUnityInvite:inviteToRespondTo withAccept:YES andCompletionBlock:^(bool success, NSString *errorMessage)
  3. {
  4. if(success)
  5. {
  6. NSLog(@"Invite was successfully accepted");
  7. Profile *senderProfile = [[Profile alloc]init];
  8. senderProfile.entityId=inviteToRespondTo.sourceEntityId;
  9.  
  10. [self readUnityObject:senderProfile withCompletionBlock:^(id object, bool success, NSString *errorMessage)
  11. {
  12. if(success)
  13. {
  14. Profile *readProfile = (Profile *)object;
  15. [self.allContacts setObject:readProfile forKey:[NSNumber numberWithInt:readProfile.entityId]];
  16.  
  17. NSMutableDictionary *temp = [[NSMutableDictionary alloc]initWithDictionary:self.pendingInvites];
  18. [temp removeObjectForKey:[NSNumber numberWithInt:readProfile.entityId]];
  19. self.pendingInvites=temp;
  20.  
  21. }
  22. else
  23. {
  24.  
  25. }
  26. }];
  27. }
  28.  
  29. else
  30.  
  31. {
  32. NSLog(@"%@",errorMessage);
  33. }
  34. }];

Report this snippet  

You need to login to post a comment.