iMessage Apps

Hey everyone!

There’s an incredible new opportunity here with iMessage apps. It’s easy to add the iMessage extension to any existing app, but I’ve been struggling with how to use Corona Enterprise within the iMessage extension. Is it even possible to do that with Corona Enterprise?

I think I have it at 95%, but the break point is the compiler scripts which do not like me emptying my App and moving Corona functionality over to a new target.

Let’s make iMessage + Corona happen!

Best,

Aidan

Any word from the Corona Team would be appreciated.

Can you post that script?

We’ve not had time to look into iMessage features and right now our engineering team is slammed with other objects. This could be a good candidate for a community built plugin.

Rob

AidanWolf

is that possible?
would you mind to share how to do that?

is that possible Rob Miracle?

I believe several people have successfully deployed stickers. You would have to use Enterprise because Stickers are made and packaged through there.

As for iMessage apps, I’m less confident that you can do this. Clearly it would take Enterprise to try. That’s simply not supported in the SDK. A plugin might be possible.

Corona’s drawing all happens on an OpenGL canvas. You could not use Corona API’s to render an iMessage screen. That takes a specific native view controller. I guess your app could let people make new images and then serve them up via iMessage’s view controller, but the utility seems rather limited.  Your app cannot access any information from the message itself. Only present things to let the user use.

How do you see this being used? You have Enterprise, have you tried to follow some iMessage tutorials and use the C-Lua bridge to pass relevant data to the iMessage view controller?

Let’s say a plugin is possible, how would you spec out the API calls? What data would you send?

Rob

HaiRob, thank you for your reply

actually what i want to do is to run my exiting code in IMessage,

i am not so smart with xcode and native c, but i try to follow from corona cards tutorial

to use viewcontroller, because it looks simmiliar.

here is my MessageViewController.m

// // MessagesViewController.m // Sticker // // Created by chandra on 11/30/16. // // #import "MessagesViewController.h" @interface MessagesViewController () @property (nonatomic, strong) CoronaViewController \*coronaController; @end @implementation MessagesViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. \_coronaController = [[[CoronaViewController alloc] init] autorelease]; [self addChildViewController:\_coronaController]; UIView \*parent = self.view; CoronaView \*coronaView = (CoronaView \*)\_coronaController.view; // Resize and center CoronaView CGRect rect = parent.frame; rect.size.width \*= 0.5; rect.size.height \*= 0.5; coronaView.frame = rect; // Half the size of the parent coronaView.center = parent.center; // Position at center [parent addSubview:coronaView]; [coronaView run]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark - Conversation Handling -(void)didBecomeActiveWithConversation:(MSConversation \*)conversation { // Called when the extension is about to move from the inactive to active state. // This will happen when the extension is about to present UI. // Use this method to configure the extension and restore previously stored state. NSLog(@"didBecomeActiveWithConversation:\n%@", conversation); } -(void)willResignActiveWithConversation:(MSConversation \*)conversation { // Called when the extension is about to move from the active to inactive state. // This will happen when the user dissmises the extension, changes to a different // conversation or quits Messages. // Use this method to release shared resources, save user data, invalidate timers, // and store enough state information to restore your extension to its current state // in case it is terminated later. } -(void)didReceiveMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when a message arrives that was generated by another instance of this // extension on a remote device. // Use this method to trigger UI updates in response to the message. } -(void)didStartSendingMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when the user taps the send button. } -(void)didCancelSendingMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when the user deletes the message without sending it. // Use this to clean up state related to the deleted message. } -(void)willTransitionToPresentationStyle:(MSMessagesAppPresentationStyle)presentationStyle { // Called before the extension transitions to a new presentation style. // Use this method to prepare for the change in presentation style. } -(void)didTransitionToPresentationStyle:(MSMessagesAppPresentationStyle)presentationStyle { // Called after the extension transitions to a new presentation style. // Use this method to finalize any behaviors associated with the change in presentation style. } @end

but when i try to run it, i got these error

objc[1523]: Class CKPPTSubTest is implemented in both /System/Library/PrivateFrameworks/ChatKit.framework/ChatKit (0x1b6422ae0) and /Applications/MobileSMS.app/MobileSMS (0x10014a9a0). One of the two will be used. Which one is undefined. 2016-12-05 14:35:26.791863 Sticker[1524:1986390] +[NSString stringWithExternalString:]: unrecognized selector sent to class 0x1b7108398 2016-12-05 14:35:26.794165 Sticker[1524:1986390] \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString stringWithExternalString:]: unrecognized selector sent to class 0x1b7108398' \*\*\* First throw call stack: (0x19203e1c0 0x190a7855c 0x1920451b8 0x192042278 0x191f3c59c 0x1000b69f8 0x1000b65f4 0x100153228 0x1000a9318 0x1000a8518 0x197e990b0 0x197e98c78 0x19875fc0c 0x192044160 0x191f37c3c 0x191f3c6ec 0x198863484 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x191f3c6ec 0x1987b4584 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x191f3c6ec 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x193be58bc 0x193be5728 0x193be5ad0 0x191fec278 0x191febbc0 0x191fe97c0 0x191f18048 0x19399e198 0x197f042fc 0x197eff034 0x19111ecc8 0x191120944 0x192c389d4 0x19a6a6158 0x19a6a5cc0 0x19a6a617c 0x192c1e6e4 0x190efc5b8) libc++abi.dylib: terminating with uncaught exception of type NSException Program ended with exit code: 0(lldb) 

maybe you can help me a little bit

Any word from the Corona Team would be appreciated.

Can you post that script?

We’ve not had time to look into iMessage features and right now our engineering team is slammed with other objects. This could be a good candidate for a community built plugin.

Rob

AidanWolf

is that possible?
would you mind to share how to do that?

is that possible Rob Miracle?

I believe several people have successfully deployed stickers. You would have to use Enterprise because Stickers are made and packaged through there.

As for iMessage apps, I’m less confident that you can do this. Clearly it would take Enterprise to try. That’s simply not supported in the SDK. A plugin might be possible.

Corona’s drawing all happens on an OpenGL canvas. You could not use Corona API’s to render an iMessage screen. That takes a specific native view controller. I guess your app could let people make new images and then serve them up via iMessage’s view controller, but the utility seems rather limited.  Your app cannot access any information from the message itself. Only present things to let the user use.

How do you see this being used? You have Enterprise, have you tried to follow some iMessage tutorials and use the C-Lua bridge to pass relevant data to the iMessage view controller?

Let’s say a plugin is possible, how would you spec out the API calls? What data would you send?

Rob

HaiRob, thank you for your reply

actually what i want to do is to run my exiting code in IMessage,

i am not so smart with xcode and native c, but i try to follow from corona cards tutorial

to use viewcontroller, because it looks simmiliar.

here is my MessageViewController.m

// // MessagesViewController.m // Sticker // // Created by chandra on 11/30/16. // // #import "MessagesViewController.h" @interface MessagesViewController () @property (nonatomic, strong) CoronaViewController \*coronaController; @end @implementation MessagesViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. \_coronaController = [[[CoronaViewController alloc] init] autorelease]; [self addChildViewController:\_coronaController]; UIView \*parent = self.view; CoronaView \*coronaView = (CoronaView \*)\_coronaController.view; // Resize and center CoronaView CGRect rect = parent.frame; rect.size.width \*= 0.5; rect.size.height \*= 0.5; coronaView.frame = rect; // Half the size of the parent coronaView.center = parent.center; // Position at center [parent addSubview:coronaView]; [coronaView run]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark - Conversation Handling -(void)didBecomeActiveWithConversation:(MSConversation \*)conversation { // Called when the extension is about to move from the inactive to active state. // This will happen when the extension is about to present UI. // Use this method to configure the extension and restore previously stored state. NSLog(@"didBecomeActiveWithConversation:\n%@", conversation); } -(void)willResignActiveWithConversation:(MSConversation \*)conversation { // Called when the extension is about to move from the active to inactive state. // This will happen when the user dissmises the extension, changes to a different // conversation or quits Messages. // Use this method to release shared resources, save user data, invalidate timers, // and store enough state information to restore your extension to its current state // in case it is terminated later. } -(void)didReceiveMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when a message arrives that was generated by another instance of this // extension on a remote device. // Use this method to trigger UI updates in response to the message. } -(void)didStartSendingMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when the user taps the send button. } -(void)didCancelSendingMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when the user deletes the message without sending it. // Use this to clean up state related to the deleted message. } -(void)willTransitionToPresentationStyle:(MSMessagesAppPresentationStyle)presentationStyle { // Called before the extension transitions to a new presentation style. // Use this method to prepare for the change in presentation style. } -(void)didTransitionToPresentationStyle:(MSMessagesAppPresentationStyle)presentationStyle { // Called after the extension transitions to a new presentation style. // Use this method to finalize any behaviors associated with the change in presentation style. } @end

but when i try to run it, i got these error

objc[1523]: Class CKPPTSubTest is implemented in both /System/Library/PrivateFrameworks/ChatKit.framework/ChatKit (0x1b6422ae0) and /Applications/MobileSMS.app/MobileSMS (0x10014a9a0). One of the two will be used. Which one is undefined. 2016-12-05 14:35:26.791863 Sticker[1524:1986390] +[NSString stringWithExternalString:]: unrecognized selector sent to class 0x1b7108398 2016-12-05 14:35:26.794165 Sticker[1524:1986390] \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString stringWithExternalString:]: unrecognized selector sent to class 0x1b7108398' \*\*\* First throw call stack: (0x19203e1c0 0x190a7855c 0x1920451b8 0x192042278 0x191f3c59c 0x1000b69f8 0x1000b65f4 0x100153228 0x1000a9318 0x1000a8518 0x197e990b0 0x197e98c78 0x19875fc0c 0x192044160 0x191f37c3c 0x191f3c6ec 0x198863484 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x191f3c6ec 0x1987b4584 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x191f3c6ec 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x193be58bc 0x193be5728 0x193be5ad0 0x191fec278 0x191febbc0 0x191fe97c0 0x191f18048 0x19399e198 0x197f042fc 0x197eff034 0x19111ecc8 0x191120944 0x192c389d4 0x19a6a6158 0x19a6a5cc0 0x19a6a617c 0x192c1e6e4 0x190efc5b8) libc++abi.dylib: terminating with uncaught exception of type NSException Program ended with exit code: 0(lldb) 

maybe you can help me a little bit