我構建了一個使用地理定位的應用程式,但我不知道如何解決有關“使用用戶位置進行跟蹤”的問題。
我試圖在 config.xml 中添加這個,但什么也沒發生......
我該如何解決這個問題?
在這里,我還添加了我的 pod 檔案。我認為每次運行 ionic 應用程式時它都會構建新的,或者?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>ShareApp</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
uj5u.com熱心網友回復:
問題在于您的Info.plist,您沒有請求訪問用戶位置的權限。錯誤(和解決方案)發布在您包含的控制臺錯誤訊息中。
您需要將以下內容添加到您的Info.plist(根據您的個人需要修改/洗掉):
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Add your description for requiring permission here</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Add your description for requiring permission here</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Add your description for requiring permission here</string>
這將告訴 iOS 您想要訪問這些功能并向用戶提供接受或拒絕的選項。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/396291.html
