xcode - CKSMSComposeRemoteViewController timed out waiting for fence barrier from com.apple.mobilesms.compose -
ok, sendsms worked fine before on ios7 , below. however, on ios8 sendsms function fails error in title of question. getting warning here (after trying resolve changing nsarray nsstring using other stack overflow questions): incompatible pointer types assigning 'nsarray *' 'nsstring *' controller.recipients = recipients; returning result of messagecomposeresultcancelled.
if (abmultivaluegetcount(phonenumbers) > 0) { phone = (__bridge_transfer nsstring*) abmultivaluecopyvalueatindex(phonenumbers, 0); [self sendsms:@"play me on pokerbuddies. download app at: https://itunes.apple.com/us/app /poker-buddies/id404168013?mt=8" recipientlist:[nsstring stringwithformat:phone, nil]]; } else { phone = @"[none]"; } - (void)sendsms:(nsstring *)bodyofmessage recipientlist:(nsstring *)recipients{ mfmessagecomposeviewcontroller *controller = [[mfmessagecomposeviewcontroller alloc] init]; if([mfmessagecomposeviewcontroller cansendtext]){ controller.body = bodyofmessage; controller.recipients = recipients; controller.messagecomposedelegate = self; [self presentviewcontroller:controller animated:yes completion:nil]; nslog(@"send sms"); } }
i have same problem messagecomposecontroller timeout issue . solved doing this.
you have create instance variable of mfmessagecomposeviewcontroller , when going present message controller have check if instance object created nil , initialize object again.so error "cksmscomposeremoteviewcontroller timed out waiting fence barrier com.apple.mobilesms.compose" not come , controller open exactly.
if ([mfmessagecomposeviewcontroller cansendtext]) { if (messagecomposer) { messagecomposer = nil; messagecomposer = [[mfmessagecomposeviewcontroller alloc]init]; } messagecomposer.recipients = arrphonenumber; messagecomposer.messagecomposedelegate = self; messagecomposer.body = @"your text"; ismessagecomposeappear = 1; [self presentviewcontroller:messagecomposer animated:yes completion:nil]; }
Comments
Post a Comment