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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: FirebaseSessions/README.md
+21-5Lines changed: 21 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,14 @@ Follow the [Main Firebase Readme](https://github.com/firebase/firebase-ios-sdk#d
6
6
## Development
7
7
### Generating the Project and Test Project
8
8
9
-
-`generate_project.sh` uses [cocoapods-generate](https://github.com/square/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.
9
+
- Test-based Development:
10
+
-**Option 1:**`generate_project.sh` uses [cocoapods-generate](https://github.com/square/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.
11
+
-**Option 2:**`open Package.swift` in the root of the firebase-ios-sdk repo. You can run tests using the `FirebaseSessionsUnit` Scheme
10
12
-`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.
11
13
12
-
### Switching dev environments - Autopush/Staging/Prod
14
+
### Debugging Options
13
15
16
+
#### Switching Dev Environments - Autopush/Staging/Prod
14
17
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.
15
18
16
19
- Enter "Edit scheme" - On the title bar menu "Product" > "Scheme" > "Edit Scheme"
@@ -23,13 +26,18 @@ SDK is configured to send events to different environments. To enforce different
23
26
24
27
NOTE: Default is PROD. Not configuring any flags would mean the events are sent to PROD environment.
25
28
26
-
### Debugging
27
-
28
-
### Command Line Arguments
29
+
#### Debugging Events
29
30
You can access command line parameters by following: Press `CMD-Shift-,` => Run => Arguments.
30
31
31
32
-`-FIRSessionsDebugEvents` will print Session Start events to the console for debugging purposes.
32
33
34
+
#### Overriding Settings
35
+
You can override the Settings values fetched from the server using the app's Info.plist. The full list of override plist keys can be found in `LocalOverrideSettings.swift`.
36
+
37
+
-**FirebaseSessionsEnabled**: Bool representing whether to make any network calls
38
+
-**FirebaseSessionsTimeout**: Float number of seconds representing the time that an app must be backgrounded before generating a new session
39
+
-**FirebaseSessionsSampingRate**: Float between 0 and 1 representing how often events are sent. 0 is drop everything, 1 is send everything.
40
+
33
41
### Updating the Proto
34
42
#### Prerequesites
35
43
To update the Sessions Proto, Protobuf is required. To install run:
@@ -42,3 +50,11 @@ brew install protobuf
42
50
1. Follow the directions in `sessions.proto` for updating it
43
51
1. Run the following to regenerate the nanopb source files: `./FirebaseSessions/ProtoSupport/generate_protos.sh`
44
52
1. Update the SDK to use the new proto fields
53
+
54
+
55
+
### Logging
56
+
The Sessions SDK uses the following strategy when determining log level:
57
+
-**Info** should be used rarely. Because the Sessions SDK is a dependency of other products, customers will not expect regular logs from the SDK. Therefore, info events are not recommended except under circumstances where the code path is blocked by another debug parameter (eg. `-FIRSessionsDebugEvents` will log under info because we don't want to require it be paired with `-FIRDebugEnabled`)
58
+
-**Debug** Is recommended to be used generously in the Sessions SDK for the purposes of debugging customer issues.
59
+
-**Warning** Is used when the Sessions SDK runs into a recoverable issue that still results in events being sent. For example, a problem converting between values that results in an incorrect value being reported.
60
+
-**Error** Is used when the Sessions SDK runs into an unrecoverable issue that prevents functionality from working. If we would want customers to reach out to us when a issue happens, then error logs should be used to convey the issue.
0 commit comments