How I can run “mapbox-gl-native” project? - ios

I’m using “Mapbox-iOS-SDK” 3.0 via cocoapods and want implement pulsing effect for annotations:
https://github.com/TransitApp/SVPulsingAnnotationView
By this link was suggested update MGLMapView.mm file:
https://stackoverflow.com/questions/33598363/implement-pulse-effect-on-annotations-in-mapbox/33768054#33768054
But for now I don’t understand how I can run “mapbox-gl-native” project?

Here are the instructions for setting up a Mapbox iOS SDK build environment. Essentially, you clone the repo and run make iproj. Once you're ready to integrate the library into your own app, you'd run make ipackage and copy the resulting binary/etc in build/ios/dynamic/ to your project.
Beware: the mapbox-gl-native project is very complicated to build, the structure still in flux, and heavy development happening every day, so any instructions that I write here are likely to not be entirely useful in the mid-future.
Adding native views to a map view is not easily accomplished (yet), but you would start here and modify/subclass/imitate MGLUserLocationAnnotationView.

Related

Avoid React-Native manual changes for iOS production build

I'm following the React-Native documentation for building iOS for production, located here:
https://facebook.github.io/react-native/docs/running-on-device.html#building-your-app-for-production
I find these instructions very strange, because it tells you to manually edit files and xcode settings. It seems extremely annoying and error-prone having to do this every time you want to create a new release.
Is there a reasonable way to automate this or use some kind of conditional for dev/prod?

How can I maintain an iOS Framework initially installed via CocoaPods but modified manually later on?

I'm currently working on a iOS (Swift) app for which I installed a few Frameworks via Cocoapods.
I have been facing a few issues with one of the frameworks and decided to tweak its code manually to run some tests and see if I could make things work.
I ended up figuring out a way to achieve what I wanted but I had to add a couple files in that framework as well as modify a few others.
This is the first time I do this and I'm almost certain this is no the best way to do things but I wanted to get some advices on how I can maintain that framework (that is behaving the way I want) in the future?
If I run "pod install" again, I suppose the framework and my changes will be overridden...
Any advice would be really appreciated.
Find the source repo (probably on GitHub) and fork it to your own account. Check out that repo and make your changes.
Optionally I would recommend making your adjustments to the code reusable so others can also use your tweaked version (make it configurable so they can turn the additional functionality on or off) and then submit a pull request back to the original repo.
If you don't want to do that you can point your Podfile directly to your customised repo using the following format:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'
Or you could look at creating your own CocoaPod (either by publishing to CocoaPods public specs repo or creating your own specs repo).

How can you permanently change iOS app configuration in Meteor Cordova?

Every time I meteor build, I have to open XCode and do the following:
remove and add an item from "Link Binary With Libraries" (Facebook SDK)
add a URL Type (custom URL scheme for my app)
add a "Required device capabilities" to "Custom iOS Target Properties"
How can I edit my Meteor project to have these steps done automatically, and to auto add things to AndroidManifest.xml?
In some way use mobile-config.js or cordova-build-override?
I'm happy to see another guy who is trying to build a hybrid application using Meteor / extending a Meteor Cordova iOS app, since I'm facing the very same issues. So I'm very happy to share my experiences and approaches with you. :-)
So far, I ended up with the following approach:
I created a base template for my iOS app using meteor build (not meteor run ios-device, since I did not know if Meteor does some optimizations for production code).
Then, I copied the whole Xcode project under /platforms/ios to another loaction and used this new project as my "master" project from then on. This project is being enriched with native code, e.g. it also includes the Cocoa Pods I'm needing.
Of course, I also did not want to copy files each and every time I trigger a new Meteor build. At least, I would like to have the Staging/www folder updated, as this is happening quite frequently.
So my first (rather naive) approach was
delete the Staging/www folder in the master project
replace it with a relative link (using Xcode's linking functionality) to the Staging/www folder inside the .meteor/local/.../ios/ project
This approach did not work, since the shell script used in the Meteor Xcode project can't handle these links.
My second approach is to create a symlink on the filesystem level instead. This works as it should, and I'm able to build the project in Xcode as it should.
I could have followed the same approach for the Cordova plugins folder, but I've decided to replace the plugins manually in order to get a better control over them, even it means a bit more effort then.
Having the symlink in place also means that Xcode's version management (and also SVN which I am using for everything) will ignore everything below Staging/www, which is good in my opinion, because I'm already versioning the webapp code in the Meteor project itself.
BTW: I've started a discussion thread on hybrid mobile app on the Meteor forums as well, but so far it did not get too much attraction:
https://forums.meteor.com/t/building-a-hybrid-meteor-cordova-app-share-experiences/8212
Maybe we could follow up on Meteor-specific things there, to have the Meteor community participate in the discussion?
EDIT: I would also like to share an approach that failed completely, at least for me, maybe I was too dumb... Before I used Meteor's Xcode template as the starting point, I also tried it "the other way round", i.e. I started with my already existing Xcode app project and tried to include Meteor's / Cordova's part by hand. Using this approach, I never managed to set everything up correctly. I had lots of troubles and also had to tweak a lot of the compiler / linker flags to even get the code compiling. This grew me a lot of gray hairs. But even after I managed to get everything to compile, Meteor hang during startup - and I never figured out why.
One remaining problem I'm still facing is that Meteor's hot code push functionality seems to have some severe issues on iOS, that are also documented as GitHub issues. It can happen that the iOS app gets completely broken and needs to be reinstalled. I tried the mdg:reload-on-resume package, but this did not work as it should and made things even worse. As far as I can tell from the GitHub discussions, one should better disable hot code push until the Meteor team has addressed these issues. Breaking the app completely due to code pushes is not what my users would expect.
Unfortunately plist values (and assumably AndroidManifest.xml as well) can only be changed by a plugin:
Add entry to iOS .plist file via Cordova config.xml

Why doesn't Xcode have an ios framework option?

I've seen project such as ios-universal-framework, but I want to know why XCode iOS does not natively support having a framework. Is it some kind of legal issue. The static library option is not good enough because I want to be able to use .dylib files in my framework.
A little background on what I want to do with a framework. I have a project that is generated from Unity3D, and when we update, we have to manually add back all of our project changes.
What I want is to use a framework that can store most of those external libraries and resources to make it easier to upgrade our project when updates are released.
From a security perspective no code is allowed to be dynamically loaded, thus only static libraries are allowed.
It is possible to create static psudo-frameworks. Take a look at GitHub iOS-Universal-Framework.
What you need is a PosprocessBuilder as described in the build pipeline described in the Unity3d Documentation.
You can manage the Xcode configurations in this pipeline using scripts like the Xcode Zerg.
I've used one python script written by a guy called Calvin Rien that worked really well, if you want to know more about this script this blog post should give you a hint.
What you really need to look for to you automate the these steps is to look for posts of Continuous Integration using Unity 3d and iOS like this one:
Unity3d: from commit to deployment onto tester devices in 20 min using Jenkins

MvvmCross sample projects run

I'm trying to introduce myself into the MVVMCross project, but I can not run the sample MonoDroid projects in the emulator. The WinPhone7 project run perfectly.
I get the following error during the Copying application to device process
http://snag.gy/PCY39.jpg
I tried the MonoCross sample projects, it runs correctly. What am I doing wrong?
I think that means that one of the Android SDK add-on libraries you are trying to use is not available on the device/emulator. An example would be if the Google maps .jar isn't on the device and you are trying to use it.
I've just pushed some changes to GitHub which separate the Maps dependencies out into a separate assembly.
You will still need Maps installed (follow instructions like http://3zwireless.com/Android1.html) for the Conference sample, but Tutorial, BestSellers, TwitterSearch, SimpleDroid, and CustomerManagement should install and run on a non-mapping Emulator.

Resources