Closed wienke closed 9 years ago
@wienke I'm guessing this is an issue with the assets bundling and/or that the Mixpanel lib is searching for it's assets in the wrong bundle.
I don't have an environment capable of reproducing this at the moment though, so it's kind of hard so say anything more than that.
@wienke Would you mind giving this a shot with v.0.3?
These features are disabled for now, see #7.
Status update:
Swizzling the UIStoryboard
loading to use another bundle is a possible solution. I gave that a quick shot last weekend, but unfortunately I was not able to get it working.
Just adding the storyboards to the assets (or Resources) folder did not work either, even though that should place them in the root of the final app bundle...
I will try to look in to this a bit further when I find the time.
:+1:
Hey @mrlundis! Any update on this?
Guys, I've been looking into it (I tried everything!) and I finally could receive in-app notifications. The bad news is that it's not a straightforward solution. Disclaimer: I'm not a Objective-C developer, I just know some basics things.
The solution steps are:
ti build ...
voilà
To test it I've added a showNotification
method on SeHyperlabMixpanelModule.m
to call it from the test app:
// SeHyperlabMixpanelModule.m
- (void)showNotification:(id)args
{
[[Mixpanel sharedInstance] showNotification];
}
app.js
...
button.addEventListener('click', function () {
mixpanel.showNotification();
});
I've been doing some research on how to do all of these steps from the titanium build command. Adding the Mixpanel SDK assets to the "assets" folder or "platform/iphone" folder in TiMixpanel will be added to the example project when building but the storyboard seems like needs to be compiled or the app will crash. I came to this conclusion looking into the app contents after doing the above steps (look to the .storyboardc
extension):
Do you know how to compile the storyboard on module or project build? What happen if we add my compiled storyboards to TiMixpanel assets for everyone who want to use the module?
Great work @inakiabt! :smile:
I'm thinking about if there's some way we can get the normal titanium build process to do this for us..
Building a normal storyboard project in Xcode outputs something along these lines:
CompileStoryboard SBTest/Base.lproj/Main.storyboard
cd /Users/jonatanlundin/Code/SBTest
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool --target-device iphone --target-device ipad --errors --warnings --notices --module SBTest --minimum-deployment-target 8.1 --output-partial-info-plist /Users/jonatanlundin/Library/Developer/Xcode/DerivedData/SBTest-hasnsyfilaskvtekpmzlrwbwxffh/Build/Intermediates/SBTest.build/Debug-iphonesimulator/SBTest.build/Main-SBPartialInfo.plist --auto-activate-custom-fonts --output-format human-readable-text --compile /Users/jonatanlundin/Library/Developer/Xcode/DerivedData/SBTest-hasnsyfilaskvtekpmzlrwbwxffh/Build/Products/Debug-iphonesimulator/SBTest.app/Base.lproj/Main.storyboardc /Users/jonatanlundin/Code/SBTest/SBTest/Base.lproj/Main.storyboard
@mrlundis that command is exactly what we need. I forked the project adding a script to compile the storyboards before build the module: https://github.com/inakiabt/TiMixpanel/blob/4a228de868976e920f10f5c6ba60ae80aac9d846/ios/compile-storyboards.sh
Would be great if you guys could test it in your environment, because it's working in my case but I can't assure it will work on any app.
Note: In my fork, I've re-enabled show surveys and notifications on active.
One possible solution might be to use a titanium cli plugin. My HockeyApp module uses a plugin to insert some code into the iOS build proces. Maybe that can be re-used and adapted? Afaik the plugin needs to be installed manually though.
https://github.com/timanrebel/HockeyApp/blob/master/iphone/plugin/hockeyapp/1.0/hooks/plugin.js
Or do we only have to compile them once? And then ship with the module? Only to recompile them when they change?
@inakiabt it is working here on iOS btw!
I guess the storyboards should be recompiled when they change, so storyboards compiled should be added to the module. I will start using this feature in our app soon (merging 0.7 with my fork). @mrlundis do you think adding the compiled storyboards is enough to realease a new version of the module?
@inakiabt I'd love to see this in a new release! And if we can do this without the need for a cli plugin, that's even better :)
Would you be up to creating the new release as a pull request? Our release process is quite simple:
Done! :+1:
Sweet! Let's continue the discussion over in #22.
I get the following error log: