samedson b84bc95e79 Sessions Internal %!s(int64=3) %!d(string=hai) anos
..
Internal b84bc95e79 Sessions Internal %!s(int64=3) %!d(string=hai) anos
ProtoSupport bcd9f76e79 [Sessions] Replace bundleID with appDisplayVersion (#10551) %!s(int64=3) %!d(string=hai) anos
Sources 0d9bf42e55 Internal API and fixes for SPM %!s(int64=3) %!d(string=hai) anos
SourcesObjC b84bc95e79 Sessions Internal %!s(int64=3) %!d(string=hai) anos
Tests 0adbd97294 Lock %!s(int64=3) %!d(string=hai) anos
README.md 92667583bf Add steps to configure different environments for the test app. (#10491) %!s(int64=3) %!d(string=hai) anos
generate_project.sh 5d9f06a4d3 [Sessions] Setup Sessions SDK Class Structure and Tests (#10297) %!s(int64=3) %!d(string=hai) anos
generate_protos.sh 442efb874e [Sessions] Add Swift Package Manager tests for Sessions (#10572) %!s(int64=3) %!d(string=hai) anos
generate_testapp.sh 9876601e14 [Sessions] Add Test App and Integration tests for the Sessions SDK (#10396) %!s(int64=3) %!d(string=hai) anos

README.md

Firebase Sessions SDK

Prerequisites

Follow the Main Firebase Readme

Development

Generating the Project and Test Project

  • generate_project.sh uses cocoapods-generate to create an Xcode Workspace that has the SDK installed for all the SDK's supported platforms. This is useful for test-based development.
  • generate_testapp.sh generates and opens a test app with the Sessions SDK included. This is useful for developing the Sessions SDK against a real app.

Switching dev environments - Autopush/Staging/Prod

SDK is configured to send events to different environments. To enforce different environments for sending events, we use an environment variable to configure the specific environment. Since environment variables are enforced in the context of the App, use the TestApp to send events to different environments after using the following configuration steps.

  • Enter "Edit scheme" - On the title bar menu "Product" > "Scheme" > "Edit Scheme"
  • Ensure "Run" is selected on the left tab
  • On the right hand side, choose the "Arguments" tab
  • Under the "Environment Variables", add the following variable to configure the environment
    • For "AUTOPUSH" - "FirebaseSessionsRunEnvironment" -> "AUTOPUSH"/"autopush"
    • For "STAGING" - "FirebaseSessionsRunEnvironment" -> "STAGING"/"staging"
    • For "PROD" - "FirebaseSessionsRunEnvironment" -> "PROD"/"prod"

NOTE: Default is PROD. Not configuring any flags would mean the events are sent to PROD environment.

Debugging

Command Line Arguments

You can access command line parameters by following: Press CMD-Shift-, => Run => Arguments.

  • -FIRSessionsDebugEvents will print Session Start events to the console for debugging purposes.

Updating the Proto

Prerequesites

To update the Sessions Proto, Protobuf is required. To install run:

brew install protobuf

Procedure

  1. Follow the directions in sessions.proto for updating it
  2. Run the following to regenerate the nanopb source files: ./FirebaseSessions/ProtoSupport/generate_protos.sh
  3. Update the SDK to use the new proto fields