Ich habe einen Code geschrieben, um Text in das Eingabefeld Messages.app in meiner iMessage-Erweiterung einzufügen.Text in aktive Konversation in iMessage setzen
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"didSelect called");
NSLog(@"%d", 1);
[[self activeConversation] insertText:@"https://google.com" completionHandler:^(NSError * error) {
NSLog(@"Error happened");
NSLog(@"Error: %@", error);
}];
NSLog(@"%d", 2);
}
Das seltsame daran ist, dass alle normalen Protokolle geschieht. Die App protokolliert "didSelect called", "1" und "2". Die Nachricht - die Google-URL - wird jedoch nicht eingefügt und die Fehlerprotokolle werden nicht angezeigt. Ich habe also keine Ahnung, was falsch läuft. Irgendeine Idee, was ich falsch mache?
Wird [self activeConversation]! = Nil? –
@ biloshkurskyi.ss Ich habe 'NSLog (@ "self.activeConversation! = Nil:% d", (self.activeConversation! = Nil)); 'hinzugefügt, was 0 zurückgibt. Es ist in der Tat null. – user4992124