Adding maps to osx application using xcode 6 - macos

Is there a way to add google maps or mapbox to osx app built with swift in xcode? Both websites only show api for ios. Is there any option to add maps to osx app without using apple maps?

I recently ported the Mapbox iOS SDK to OS X. It can be used with either Objective-C or Swift on OS X 10.10.0 and above. Until there’s an official release, you’ll need to clone the mapbox/mapbox-gl-native repository on GitHub and build the project from source. Most of the Mapbox iOS SDK documentation applies equally to the OS X port. The project comes with a demo application as well (via make xproj).
Update: You don’t have to build it from source anymore! See https://github.com/mapbox/mapbox-gl-native/releases/ for prebuilt releases of the Mapbox macOS SDK. (Look for releases beginning with “macos-”.) See the SDK’s homepage for more information and an API reference.

There is no google-maps SDK for OS X. Your only way to go to is add a webView into your app and load a html that contains maps api calls linked to your AUTHORIZATION TOKEN.

Technically Mapbox GL runs on OS X, but it's direct C++, which means that you'd have to wrap it in Objective-C in order to use it with Swift, but it is possible.

Related

Can I mix Catalyst with MacOS target?

Environment: Mac mini M1; and iPhone 6s Plus, etc.
Mac OS 11+, iOS 14+
I'm using SwiftUI/Combine Frameworks versus Storyboard.
Scenario: I have an iOS application that I want to expand into a MacOS sister application; and probably add more functionality too.
I assume that 'Catalyst' is an option on the iOS side to map it to the MacOS environment without hassle with the code.
I also assume that from this baseline, I could create a MacOS target and share common code between the two and add compiler directives to separate the MacOS & iOS specifics.
Am I correct?
Given an iOS target that is Catalyst enabled (eg the "Mac" checkbox checked), you can use any frameworks/functions marked as available in iOS and Catalyst.
You can also conditionally compile for the different systems using things like:
#if targetEnvironment(macCatalyst)
or various #available configurations (https://nshipster.com/available/).
If your question is whether you can use macOS-specific code (not marked as available in Catalyst), like AppKit, for example, the question becomes more complicated. One can import and use a bundle with AppKit code, but it's not what I would call a streamlined process. See: https://www.highcaffeinecontent.com/blog/20190607-Beyond-the-Checkbox-with-Catalyst-and-AppKit

Nativescript & iOS DeviceCheck API

My team has a nativescript-vue application that is targeting the iOS platform. We were trying to uniquely identify the iOS device uuid via nativescript-uuid, but that appears to no longer supported. What is the best approach to use the DeviceCheck API?
You were right nativescript-uuid plugin is not updated to work with iOS 11 or later (DeviceCheck API).
An alternative could be using nativescript-secure-storage plugin, store the UUID you get using UIDevice.currentDevice.identifierForVendor.UUIDString for the first time, then it should return the same value even after reinstalling the app.

Rejected from Apple Mac Store because using Xamarin implementation of NEVPNManager

Today we got rejected from Apple Mac Store because we used Xamarin implementation of NEVPNManager in our Mac application.
Your app includes VPN services but does not use the NEVPNManager API to deliver these services.
Previously we had the VPN functionality in an objective c library (that was binded) and we got accepted. Now we removed the objective c library and used the xamarin implementation and we got rejected.
Why did Apple reject us? #Xamarin are you using NEVPNManager in your implementation?
You can find the answer on Xamarin Forum:
https://forums.xamarin.com/discussion/comment/328214?
Thanks to #Chris Hamons for the help!
Solution:
Adding --link_flags="-framework NetworkExtension" to Additional MMP Arguments in Project Options -> Build -> Mac Build fixed the issue.
In theory those should be added automatically. Seems like a potential bug.

Is it safe to use Apple's Private Framework UXKit for MacOS application development?

While searching for an alternative of UIKit for MacOS, I came across UXKit (a private framework used by Apple to develop new Photos app). I found one demo app made with UXKit here and another demo app here. They include headers of UXKit, generated by class-dump. Both of the apps build and runs on MacOS (High Sierra 10.13.1) successfully.
The question is if we include these headers in an Xcode project and develop MacOS app, will it be safely published on Mac AppStore? If No, then is it okay to use UXKit in MacOS apps and publish them outside Mac AppStore.
Read more about UXKit here.
I came across Chameleon, but it looks like it is not maintained for a long and it is not using UXKit (it is trying to mimic UXKit), so I'm not interested in it.
No, it's not safe to use a system private framework in a shipping application. The framework could change in incompatible ways between OS versions, or even be removed completely.

Can I have a cross-platform framework for OS X and tvOS?

I am writing a tvOS app. Up to now I was developing the code as an OS X framework with a prototyping OS X app.
Now I would like to add the production tvOS app into the mix, keeping the OS X prototype. Which means I need the framework to be built both for OS X and tvOS. This should not be a problem in the principle, since I only use frameworks available on both platforms.
Is it possible to build a cross-platform framework? What settings do I use?
Yes it's commonly done. Create a new Xcode target, targetting tvOS, and add the same source files as the OSX target.
If you need to include/exclude/change code or behaviour at compile time then you need to #import <TargetConditionals.h>.

Resources