Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework 爱奥尼亚/科尔多瓦:如何通过fastlane或xcodebuild增加推送功能?_Ionic Framework_Xcode8_Ios10_Xcodebuild_Fastlane - Fatal编程技术网

Ionic framework 爱奥尼亚/科尔多瓦:如何通过fastlane或xcodebuild增加推送功能?

Ionic framework 爱奥尼亚/科尔多瓦:如何通过fastlane或xcodebuild增加推送功能?,ionic-framework,xcode8,ios10,xcodebuild,fastlane,Ionic Framework,Xcode8,Ios10,Xcodebuild,Fastlane,我有一个使用Ionic.io推送消息的Ionic项目。它由Fastlane构建,并通过HockeyApp部署 由于升级到Xcode 8,推送通知在iOS 10上不再有效 我有一个包含push授权的授权文件,它使用ruby脚本添加到xcode项目文件中,请参阅 当我用Fastlane构建项目时,push仍然不起作用。当我在Xcode中打开项目文件并查看“功能”部分时,它会在“将推送通知权限添加到权限文件”中显示复选标记,但在“将推送通知功能添加到应用程序id”中显示错误 如果我按“修复并重建”,则

我有一个使用Ionic.io推送消息的Ionic项目。它由Fastlane构建,并通过HockeyApp部署

由于升级到Xcode 8,推送通知在iOS 10上不再有效

我有一个包含push授权的授权文件,它使用ruby脚本添加到xcode项目文件中,请参阅

当我用Fastlane构建项目时,push仍然不起作用。当我在Xcode中打开项目文件并查看“功能”部分时,它会在“将推送通知权限添加到权限文件”中显示复选标记,但在“将推送通知功能添加到应用程序id”中显示错误

如果我按“修复并重建”,则“推送”会起作用

所以我的问题是:


我希望能够正确地启用推送功能,只使用Fastlane、xcodebuild、ruby或其他工具,只要它只在命令行中,并且允许干净地构建ionic项目

所以我通过做两件事来让它工作:

我从xcode中删除了所有旧的配置文件。这扭转了问题,因此Xcode抱怨推送权限没有添加到我的权限文件中,但在将推送通知功能添加到应用程序id中时有一个复选标记。 接下来,我修改了脚本,将项目文件包含在项目本身中。我已经被告知,这可能与不使用快车道的比赛有关。 感谢并为我提供了90%的帮助

!/usr/bin/env ruby 需要“xcodeproj” name=ARGV[0] projectpath=../platforms/ios/+name+.xcodeproj 将添加权限推送到+名称 放置打开+项目路径 proj=Xcodeproj::Project.openprojectpath 权利\路径=姓名+/+姓名+。权利 group\u name=proj.root\u object.main\u group.name file=proj.new\u文件权限\u路径 属性={} 项目目标。每个do |目标| 属性[target.uuid]={SystemCapabilities=>{com.apple.Push=>{enabled=>1}} target.add_file_references[文件] 添加到目标的放置:+target.uuid 终止 项目根对象属性['TargetAttribute']=属性 proj.build|u configurations.each do| config| config.build\u settings.storeCODE\u签名\u权限,权限\u路径 终止 放置添加的权利文件路径:+authentication\u路径 项目保存
因此,我通过做两件事使它工作:

我从xcode中删除了所有旧的配置文件。这扭转了问题,因此Xcode抱怨推送权限没有添加到我的权限文件中,但在将推送通知功能添加到应用程序id中时有一个复选标记。 接下来,我修改了脚本,将项目文件包含在项目本身中。我已经被告知,这可能与不使用快车道的比赛有关。 感谢并为我提供了90%的帮助

!/usr/bin/env ruby 需要“xcodeproj” name=ARGV[0] projectpath=../platforms/ios/+name+.xcodeproj 将添加权限推送到+名称 放置打开+项目路径 proj=Xcodeproj::Project.openprojectpath 权利\路径=姓名+/+姓名+。权利 group\u name=proj.root\u object.main\u group.name file=proj.new\u文件权限\u路径 属性={} 项目目标。每个do |目标| 属性[target.uuid]={SystemCapabilities=>{com.apple.Push=>{enabled=>1}} target.add_file_references[文件] 添加到目标的放置:+target.uuid 终止 项目根对象属性['TargetAttribute']=属性 proj.build|u configurations.each do| config| config.build\u settings.storeCODE\u签名\u权限,权限\u路径 终止 放置添加的权利文件路径:+authentication\u路径 项目保存
对于Xcode 10.1和Cordova 4.5.5,我必须像这样重写脚本:

def启用推送通知 fastlane_需要“xcodeproj” fastlane_需要“文件工具” 应用程序名称=获取应用程序名称 将推送权限添加到{app_name} proj=Xcodeproj::Project.openFile.expand_path../platforms/ios/{app_name}.Xcodeproj 属性={} 项目目标。每个do |目标| 属性[target.uuid]={SystemCapabilities:{com.apple.Push:{enabled:1}} 添加到目标的放置:+target.uuid 终止 项目根对象属性['TargetAttribute']=属性 FileUtils.cp\r File.expand_path./overrides/authentications-Debug.plist, File.expand_path../platforms/ios/{app_name}/authentications-Debug.plist, 删除目的地:true FileUtils.cp\r File.expand_path./overrides/authentications-Release.plist, File.expand_path../platforms/ios/{app_name}/authentications-Release.plist, 删除目的地:true 项目保存 puts[确定]已添加推送权限 终止 在这里,我没有创建.authentications文件,而是使用相同的内容覆盖了另外两个文件authentications-Release.plist和authentications-Debug.plist:

aps环境 发展
对于Xcode 10.1和Cordova 4.5.5,我必须像这样重写脚本:

def启用推送通知 fastlane_需要“xcodepro” j' fastlane_需要“文件工具” 应用程序名称=获取应用程序名称 将推送权限添加到{app_name} proj=Xcodeproj::Project.openFile.expand_path../platforms/ios/{app_name}.Xcodeproj 属性={} 项目目标。每个do |目标| 属性[target.uuid]={SystemCapabilities:{com.apple.Push:{enabled:1}} 添加到目标的放置:+target.uuid 终止 项目根对象属性['TargetAttribute']=属性 FileUtils.cp\r File.expand_path./overrides/authentications-Debug.plist, File.expand_path../platforms/ios/{app_name}/authentications-Debug.plist, 删除目的地:true FileUtils.cp\r File.expand_path./overrides/authentications-Release.plist, File.expand_path../platforms/ios/{app_name}/authentications-Release.plist, 删除目的地:true 项目保存 puts[确定]已添加推送权限 终止 在这里,我没有创建.authentications文件,而是使用相同的内容覆盖了另外两个文件authentications-Release.plist和authentications-Debug.plist:

aps环境 发展
如果在目标迭代器下仍未设置.authentications,请在目标迭代器内添加'target.build_configurations.each do | config | config.build_settings.storeCODE_SIGN_authentications,authentications_path end'。如果在目标迭代器下仍未设置.authentications,在目标迭代器中添加'target.build_configurations.each do | config | config.build_settings.storeCODE _SIGN_权限、权限_pathend'。