Closed swyxio closed 7 years ago
Hi @sw-yx! Thanks for checking out the repo/blog post!
Hmm, I haven't run into that problem yet. After editing the extension, you re-compiled the ios project, correct? I believe that's necessary rather than relying on live-reloading for the action extension.
If there were an error preventing it being displayed, I'd expect it would show up in the logs 🤔 Do you have the code available somewhere that I might be able to check it out?
Hi Patrick!!
i think one possible source of misunderstanding is what you mean by re-compiling the ios project. (this is basically my 2nd experience with RN/XCode so pardon the noobiness to follow) I've tried to do it a few different ways but had no change in result.
currently I am getting to the simulator via react-native run-ios
. this recompiles from react-native every time reliably (i have also tried deleting the ios/build
folder and rerunning). is this what you refer to when you say to recompile the ios project? or do you mean to build it from within XCode (which I am finding doesnt really work for me either launching within simulator or on a connected iPhone).
I have uploaded my attempt to debug this. Here: https://github.com/sw-yx/tryIgnitePromptworks/blob/master/App/Containers/App.js#L31 You can see that i have inserted a console log for every render of App.
console.log
fires when i launch the app as a standalone app in my simulator, and the isActionExtension
is present and false
as expected (hence I have evidence the app is recompiled). I'm not sure how to debug this. I'm going to scrap this attempt and retry from scratch to see if I still get the same issue (maybe skipping ahead to conditionally rendering things before i enable the share extension, i dont know if that helps).
currently I am getting to the simulator via react-native run-ios. this recompiles from react-native every time reliably (i have also tried deleting the ios/build folder and rerunning). is this what you refer to when you say to recompile the ios project?
Yup, that's exactly what I mean by "re-compile". For most react-native development, you don't need to recompile after changing just the javascript, so I just wanted to make sure that you were indeed rebuilding the app.
I think I found the issue -- the module name in the action extension doesn't match the module name of your app. Line 31 of ActionViewController.m
should match the module name from AppDelegate.m
. So changing it to moduleName:@"ActionExtensionExample"
and re-running react-native run-ios
should let you see your action extension.
hey Patrick! thanks so much for your reply. I cannot express in words how much I appreciate it, I really do. I even looked up Promptworks to learn more about your awesome company!
This solution seems bang-on but unfortunately I am not able to test it because I am now running into unrelated react-native (possibly XCode) issues. All ignite
apps, even ones I am starting from scratch, are just refusing to launch on Simulator for me now: The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application "org.reactjs.native.example.ActionExtensionExample.Action2" is unknown to FrontBoard").
. I filed it on StackOverflow here if you are interested but I don't think this has anything to do with this particular issue. I dont know if it is because of me maxing out my bundle identifiers but at this point I dont have any other choice than to wait out 10 days and try again since I have tried basically everything else. I'll revisit in 10 days and hopefully try to get this going again.
@patricksmith i retried by creating a completely new apple id and signed in to xcode with that so it would stop giving me bundle identifier hell. And that seems to have solved the issue!!!!!! (together with your earlier detective work about the matching module names). Thank you so much! closing the issue.
I definitely feel like RN is far more stressful than really necessary but cant complain too much...
hi guys,
thanks for the very good tutorial. i have gotten the furthest with you guys. however i got stuck at the stage where it was supposed to rebuild to show some words:
it just shows a blank screen for me (which is where it was when i first got it up). i tried to insert some console.logs here and there to debug but this is clearly not a javascript problem. any ideas how to fix?