简体   繁体   English

如何在 Cordova 中正确添加带有位置的 iOS 框架并从中创建插件?

[英]How to properly add iOS framework with location and create plugin from it in Cordova?

I am writing Cordova plugin which wrap iOS framework which use location in background.我正在编写 Cordova 插件,它包装了在后台使用位置的 iOS 框架。 I have added necessary permissions and I have wrapped iOS framework successfully, but the location did not updates to me while I am moving.我已经添加了必要的权限并且我已经成功包装了 iOS 框架,但是在我移动时位置没有更新给我。 I got message from Cordova, please take a look at image.我收到来自 Cordova 的消息,请看一下图片。 在此处输入图片说明

It start receiving updates when I moved the code which enables location manager into AppDelegate class.当我将启用位置管理器的代码移动到 AppDelegate 类时,它开始接收更新。 If that code is at some other class, the prompt window for location permission will appear but the monitoring of location changes will not work.如果该代码在其他某个类,则会出现位置权限的提示窗口,但位置更改的监控将不起作用。 I am not totally sure why is that, but it works now :D我不完全确定为什么会这样,但它现在有效:D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM