NutritionIASDK
描述
NutritionIASDK 是一个综合性的智能、自动和自适应营养框架,用 Swift 编程在 iOS 和 iPadOS 上执行。这是将我们的营养功能与任何第三方集成最便捷的方式。
安装
NutritionIASDK 可通过 CocoaPods 获得。要安装它,只需将以下行添加到您的 Podfile 中。
pod 'NutritionIASDK', :git => 'https://github.com/miguelmunozfer/VitaleNutritionIASDK'
将以下行添加到 podfile 文件的末尾
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
使用方法
简单的一行设置
使用您的凭据启动SDK。您的APP_ID必须是永久且独一无二的,每个应用程序用户(包括您已经在系统中使用的任何用户ID)均可使用。
NutritionSDK.sharedInstance.startSession(with: MEMBER_ID, appID: APP_ID, password: APP_PASSWORD)
营养档案
NutritionSDK.sharedInstance.showProfile()
显示营养模块
NutritionSDK.sharedInstance.showNutritionModule()
自定义配置
您可以使用这些函数来自定义不同的营养模块界面
主颜色
主 SDK 颜色可以个性化设置。所有按钮和营养模块的主要元素将变成所选颜色。
NutritionSDK.sharedInstance.setMainColor(color: MAIN_APP_COLOR)