iOS Guide

Mk5 edited this page Sep 7, 2018 · 3 revisions

NOTE! Firebase Crash Reporting will be unavailable after 9 September 2018. Crash reporting should be done by Crashlytics and Fabric. Read this Crashlytics wiki page if you need it

iOS platform is more challenging than Android, please read the all 4 steps of following guide.

Multi-OS engine 1.3.6+

1. Add firebase configuration file in to your project

Open xcode project (you can find it inside ios-moe module or you can open it by right click on ios-moe module and choosing Open Xcode Project) and drag GoogleService-Info.plist file (you can download it from firebase console) to project root folder. Path should be as follows: ios-moe/xcode/ios-moe/GoogleService-Info.plist

xcode firebase config

2. Install framework (Pods)

2.1 Init pods

$ cd ios-moe/xcode
$ pod init

2.2 Add pods ios-moe/xcode/Podfile

target 'ios-moe' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for ios-moe
  pod 'Firebase/Core', '5.2.0'
  pod 'Firebase/Storage', '5.2.0'
  pod 'Firebase/Database', '5.2.0'
  pod 'Firebase/Crash', '5.2.0'
  pod 'Firebase/Auth', '5.2.0'
  pod 'Firebase/Messaging', '5.2.0'
  pod 'GoogleSignIn', '4.1.2'
  pod 'Fabric', '~> 1.7.11'
  pod 'Crashlytics', '~> 3.10.7'
  
end
# !! add this also !!
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

2.3 Install

$ pod install

2.4 Add Pods.xconfig to custom.xconfig. Open ios-moe/build.gradle and look for copyNatives task

Replace this:

def outFlags = file("xcode/ios-moe/custom.xcconfig");
outFlags.write LD_FLAGS

With this:

def outFlags = file("xcode/ios-moe/custom.xcconfig");
def FIREBASE_PODS = "#include \"Pods/Target Support Files/Pods-ios-moe/Pods-ios-moe.release.xcconfig\"\n"
outFlags.write FIREBASE_PODS + LD_FLAGS

3. Change project launch configuration

Add workspace and mainScheme to moe/xcode settings: ios-moe/build.gradle

// Setup Multi-OS Engine
moe {
    xcode {
        project 'xcode/ios-moe.xcodeproj'
        workspace 'xcode/ios-moe.xcworkspace'   // Workspace is needed when Pods was included in project
        mainScheme 'ios-moe'
        mainTarget 'ios-moe'
        testTarget 'ios-moe-Test'
    }
}

4. Update proguard files and all is done!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.