@@ -211,13 +211,60 @@ static NSString *_Nonnull const BugsnagSeverityInfo = @"info";
211211 (BOOL )writeBinaryImagesForUserReported ;
212212
213213/* *
214- * Manually starts tracking a new session.
214+ * Starts tracking a new session.
215215 *
216- * Sessions automatically start when the application enters the foreground state, and end when the application exits
217- * the foreground.If you wish to manually start sessions, simply call this method from the relevant part of your
218- * application. Starting a new session will automatically end the previous one.
216+ * By default, sessions are automatically started when the application enters the foreground.
217+ * If you wish to manually call startSession at
218+ * the appropriate time in your application instead, the default behaviour can be disabled via
219+ * shouldAutoCaptureSessions.
220+ *
221+ * Any errors which occur in an active session count towards your application's
222+ * stability score. You can prevent errors from counting towards your stability
223+ * score by calling stopSession and resumeSession at the appropriate
224+ * time in your application.
225+ *
226+ * @see stopSession:
227+ * @see resumeSession:
219228 */
220-
221229+ (void )startSession ;
222230
231+ /* *
232+ * Stops tracking a session.
233+ *
234+ * When a session is stopped, errors will not count towards your application's
235+ * stability score. This can be advantageous if you do not wish these calculations to
236+ * include a certain type of error, for example, a crash in a background service.
237+ * You should disable automatic session tracking via shouldAutoCaptureSessions if you call this method.
238+ *
239+ * A stopped session can be resumed by calling resumeSession,
240+ * which will make any subsequent errors count towards your application's
241+ * stability score. Alternatively, an entirely new session can be created by calling startSession.
242+ *
243+ * @see startSession:
244+ * @see resumeSession:
245+ */
246+ + (void )stopSession ;
247+
248+ /* *
249+ * Resumes a session which has previously been stopped, or starts a new session if none exists.
250+ *
251+ * If a session has already been resumed or started and has not been stopped, calling this
252+ * method will have no effect. You should disable automatic session tracking via
253+ * shouldAutoCaptureSessions if you call this method.
254+ *
255+ * It's important to note that sessions are stored in memory for the lifetime of the
256+ * application process and are not persisted on disk. Therefore calling this method on app
257+ * startup would start a new session, rather than continuing any previous session.
258+ *
259+ * You should call this at the appropriate time in your application when you wish to
260+ * resume a previously started session. Any subsequent errors which occur in your application
261+ * will be reported to Bugsnag and will count towards your application's stability score.
262+ *
263+ * @see startSession:
264+ * @see stopSession:
265+ *
266+ * @return true if a previous session was resumed, false if a new session was started.
267+ */
268+ + (BOOL )resumeSession ;
269+
223270@end
0 commit comments