Cannot InsertText with Message App Extension

40 views Asked by At

I'm creating a Message App Extension in Xamarin and am getting a NSException error when trying to InsertText from the MessagesViewController. I do not see error messages when building, just when this InsertText code is executed. Appreciate your help/expertise.

InsertText code

public void InsertMessage(string message)
{
    ActiveConversation.InsertText(message, (err) => {
        if (err != null)
        {
            Console.WriteLine("ERROR: " + err.ToString());
        }
    });
    Console.WriteLine("Inserted text");
}

Console Error Message

2022-10-19 14:17:02.869031-0700 MobileSMS[40085:1435095] -[CKIMDaemonController preWarm]: unrecognized selector sent to instance 0x60000326aa80
2022-10-19 14:17:02.871325-0700 MobileSMS[40085:1435095] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CKIMDaemonController preWarm]: unrecognized selector sent to instance 0x60000326aa80'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007ff800427378 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff80004dbaf objc_exception_throw + 48
    2   CoreFoundation                      0x00007ff800436588 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
    3   CoreFoundation                      0x00007ff80042b83d ___forwarding___ + 1431
    4   CoreFoundation                      0x00007ff80042db38 _CF_forwarding_prep_0 + 120
    5   IMCore                              0x00007ff810903f11 IMCoreSimulatedEnvironmentEnabled + 155997
    6   ChatKit                             0x00000001098998c0 __46-[CKChatInputController _startEditingPayload:]_block_invoke + 591
    7   ChatKit                             0x00000001099f25ae __69+[CKComposition compositionWithShelfPluginPayload:completionHandler:]_block_invoke + 115
    8   libdispatch.dylib                   0x00007ff80013b7fb _dispatch_call_block_and_release + 12
    9   libdispatch.dylib                   0x00007ff80013ca3a _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x00007ff80014c32c _dispatch_main_queue_drain + 1338
    11  libdispatch.dylib                   0x00007ff80014bde4 _dispatch_main_queue_callback_4CF + 31
    12  CoreFoundation                      0x00007ff8003869f7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    13  CoreFoundation                      0x00007ff8003813c6 __CFRunLoopRun + 2482
    14  CoreFoundation                      0x00007ff800380637 CFRunLoopRunSpecific + 560
    15  GraphicsServices                    0x00007ff809c0f28a GSEventRunModal + 139
    16  UIKitCore                           0x00000001145c4425 -[UIApplication _run] + 994
    17  UIKitCore                           0x00000001145c9301 UIApplicationMain + 123
    18  MobileSMS                           0x0000000106198220 MobileSMS + 131616
    19  dyld                                0x00000001063ed2bf start_sim + 10
    20  ???                                 0x000000010d42a52e 0x0 + 4517438766
)
libc++abi: terminating with uncaught exception of type NSException
1

There are 1 answers

2
bbrooke On

The error seems to be related to using the iPhone simulator, as I got it to work on a connected device without any errors.