<commit_before># Rollbar for iOS

<!-- RemoveNext -->
Objective-C library for crash reporting and logging with [Rollbar](https://rollbar.com).

## Setup

1. Download the [Rollbar framework](https://github.com/rollbar/rollbar-ios/releases/download/v0.0.1/Rollbar.zip)

2. Extract the Rollbar directory in the zip file to your Xcode project directory.

3. In Xcode, select File -> Add Files to "[your project name]" and choose the Rollbar folder

4. In your Application delegate implementation file, add the following import statement:

    ```objective-c
    #import <Rollbar/Rollbar.h>
    ```

5. Add the following to `application:didFinishLaunchingWithOptions:`:

    ```objective-c
    [Rollbar initWithAccessToken:@"POST_CLIENT_ITEM_ACCESS_TOKEN"];
    ```

    <!-- RemoveNext -->
    Replace POST_CLIENT_ITEM_ACCESS_TOKEN with a client scope access token from your project in Rollbar.

That's all you need to do to report crashes to Rollbar. To get symbolicated stack traces, follow the instructions in the "Symbolication" section below.

## Usage

### Crash reporting

Rollbar uses [PLCrashReporter](https://www.plcrashreporter.org/) to capture uncaught exceptions and fatal signals. Only one crash reporter can be active per app, so make sure to only use Rollbar for crash reporting (or at least have Rollbar be the the last crash reporter initialized in your app delegate).

Crashes will be saved to disk when they occur, then reported to Rollbar the next time the app is launched.

### Logging

You can log arbitrary messages using the log methods:

```objective-c
// Logs at level "info".
// Variants at "debug", "info", "warning", "error", and "critical" all exist.
[Rollbar infoWithMessage:@"Test message"];

// Log a critical, with some additional key-value data
[Rollbar criticalWithMessage:@"Unexcpected data from server" data:@{@"endpoint": endpoint,
                                                                    @"result": result}];

// Or log at a named level
[Rollbar logWithLevel:@"warning" message:@"Simple warning log message"];
```


## Configuration

You can pass an optional `RollbarConfiguration` object to `initWithAccessToken:`:

```objective-c<commit_msg>tweak wording<commit_after># Rollbar for iOS

<!-- RemoveNext -->
Objective-C library for crash reporting and logging with [Rollbar](https://rollbar.com).

## Setup

1. Download the [Rollbar framework](https://github.com/rollbar/rollbar-ios/releases/download/v0.0.1/Rollbar.zip)

2. Extract the Rollbar directory in the zip file to your Xcode project directory.

3. In Xcode, select File -> Add Files to "[your project name]" and choose the Rollbar folder

4. In your Application delegate implementation file, add the following import statement:

    ```objective-c
    #import <Rollbar/Rollbar.h>
    ```

5. Add the following to `application:didFinishLaunchingWithOptions:`:

    ```objective-c
    [Rollbar initWithAccessToken:@"POST_CLIENT_ITEM_ACCESS_TOKEN"];
    ```

    <!-- RemoveNext -->
    Replace POST_CLIENT_ITEM_ACCESS_TOKEN with a client scope access token from your project in Rollbar.

That's all you need to do to report crashes to Rollbar. To get symbolicated stack traces, follow the instructions in the "Symbolication" section below.

## Usage

### Crash reporting

Crashes will be saved to disk when they occur, then reported to Rollbar the next time the app is launched.

Rollbar uses [PLCrashReporter](https://www.plcrashreporter.org/) to capture uncaught exceptions and fatal signals. Note that only one crash reporter can be active per app. If you initialize multiple crash reporters (i.e. Rollbar alongside other services), only the last one initialized will be active.

### Logging

You can log arbitrary messages using the log methods:

```objective-c
// Logs at level "info".
// Variants at "debug", "info", "warning", "error", and "critical" all exist.
[Rollbar infoWithMessage:@"Test message"];

// Log a critical, with some additional key-value data
[Rollbar criticalWithMessage:@"Unexcpected data from server" data:@{@"endpoint": endpoint,
                                                                    @"result": result}];

// Or log at a named level
[Rollbar logWithLevel:@"warning" message:@"Simple warning log message"];
```


## Configuration

You can pass an optional `RollbarConfiguration` object to `initWithAccessToken:`:

```objective-c
{'fraction_non_alphanumeric': 0.0975554032442312, 'fraction_numerical': 0.003655471784327165, 'mean_word_length': 3.8752783964365256, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2382821', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1150, 'n_words': 491}