2016-10-15 146 views
3

我试图运行在Xcode每次我建造时间的应用程序和,它说:应用程序不恰当声明UIBackgroundMode

请求被服务代理(SBMainWorkspace)为理由拒绝:已禁用(“无法启动NameOfApp,因为这个应用程序没有声明适当的UIBackgroundMode“)。

我不知道我做了什么导致这个或如何解决这个问题。

的info.plist源代码:

<?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>GTFoos</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>UIStatusBarTintParameters</key> 
    <dict> 
     <key>UINavigationBar</key> 
     <dict> 
      <key>Style</key> 
      <string>UIBarStyleDefault</string> 
      <key>Translucent</key> 
      <false/> 
     </dict> 
    </dict> 
    <key>UISupportedInterfaceOrientations</key> 
    <array> 
     <string>UIInterfaceOrientationPortrait</string> 
    </array> 
    <key>UISupportedInterfaceOrientations~ipad</key> 
    <array> 
     <string>UIInterfaceOrientationPortrait</string> 
     <string>UIInterfaceOrientationPortraitUpsideDown</string> 
     <string>UIInterfaceOrientationLandscapeLeft</string> 
     <string>UIInterfaceOrientationLandscapeRight</string> 
    </array> 
</dict> 
</plist> 
+0

你好。你可以在你的问题中包含你的主Info.plist文件的内容吗?右键单击,以源代码打开 – McNight

+0

我将其添加为编辑。 – mcbeezus

+0

查看项目的功能面板(列出所有特定iOS功能(iCloud,Siri ...))并查看“背景模式”部分。请告诉我们是否有任何检查。 – McNight

回答

2

我知道这非常晚,但可能这会帮助另外一个人

<key>UIBackgroundModes</key> 
<array> 
    <string>fetch</string> 
    <string>remote-notification</string> 
</array> 
0

检查Xcode项目的方案:运行:

并确保“后台抓取:启动到期到后台获取事件“选项未打开。

相关问题