Responding to an Invite


/ Published in: Objective C
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.