Skip to content

Chore: Update README.md. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 32 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

⚠️ ⚠️
We are no longer maintaining this library. Feel free to fork it and work on your own branch.
⚠️ ⚠️

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Iterable Flutter Plugin

Flutter plugin to support Android and iOS push notifications from [https://iterable.com/](https://iterable.com/).

# Iterable Plugin
[![Pub Version](https://img.shields.io/pub/v/iterable_flutter)](https://pub.dev/packages/iterable_flutter)
[![Build](https://github.com/la-haus/iterable-flutter/actions/workflows/build.yml/badge.svg)](https://github.com/la-haus/iterable-flutter/actions/workflows/build.yml)
[![Lint](https://github.com/la-haus/iterable-flutter/actions/workflows/lint.yml/badge.svg)](https://github.com/la-haus/iterable-flutter/actions/workflows/lint.yml)
[![Tests](https://github.com/la-haus/iterable-flutter/actions/workflows/test.yml/badge.svg)](https://github.com/la-haus/iterable-flutter/actions/workflows/test.yml)
---

> **This library is in alpha** so the implementation details could change a lot from version to version,
> check releases and [CHANGELOG.md](CHANGELOG.md) to know how it changes over time.
This is the **Spring Health** fork of the (now abandoned) [iterable_flutter](https://github.com/la-haus/iterable-flutter) project.
As a result, this is not officially published via pub.dev, with the installation process being that of any, non-pub.dev published packag/plugin.

Flutter plugin to support Android and iOS push notifications from [https://iterable.com/](https://iterable.com/).
---

## Usage

To use this plugin, add `iterable_flutter` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).

### Supported methods
| Method | Android | iOS | Web | MacOS | Windows | Linux |
|---|---|---|---|---|---|---|
| `initialize` | X | X | | | | |
| `setEmail` | X | X | | | | |
| `setUserId` | X | X | | | | |
| `registerForPush` | X | X | | | | |
| `updateUser` | X | X | | | | |
| `signOut` | X | X | | | | |
| `track` | X | X | | | | |
| `setNotificationOpenedHandler` | X | X | | | | |

| Method | Android | iOS | Web | MacOS | Windows | Linux |
| ------------------------------ | ------- | --- | --- | ----- | ------- | ----- |
| `initialize` | X | X | | | | |
| `setEmail` | X | X | | | | |
| `setUserId` | X | X | | | | |
| `registerForPush` | X | X | | | | |
| `updateUser` | X | X | | | | |
| `signOut` | X | X | | | | |
| `track` | X | X | | | | |
| `setNotificationOpenedHandler` | X | X | | | | |

## Installation

1. Add `iterable_flutter` as a plugin in `pubspec.yaml` with the version you need like this:

```yaml
iterable_flutter: 0.5.4
iterable_flutter:
git:
url: https://github.com/mabidakun/iterable-flutter.git
ref: 0.6.0-MA-SH
```

2. Use `IterableFlutter.initialize` to set your iterable keys.
> First, create a mobile API Key from [Iterable](https://support.iterable.com/hc/en-us/articles/360043464871#creating-api-keys).
> Then, also from Iterable, [create a mobile app](https://support.iterable.com/hc/en-us/articles/115000331943#_2-create-a-mobile-app-in-iterable) and [assign a push integration](https://support.iterable.com/hc/en-us/articles/115000331943#_3-assign-a-push-integration-to-the-mobile-app)
to it.
> First, create a mobile API Key from [Iterable](https://support.iterable.com/hc/en-us/articles/360043464871#creating-api-keys).
> Then, also from Iterable, [create a mobile app](https://support.iterable.com/hc/en-us/articles/115000331943#_2-create-a-mobile-app-in-iterable) and [assign a push integration](https://support.iterable.com/hc/en-us/articles/115000331943#_3-assign-a-push-integration-to-the-mobile-app)
> to it.

```dart
class _MyAppState extends State<MyApp> {
@override
Expand All @@ -58,12 +57,14 @@ class _MyAppState extends State<MyApp> {
```

3. Identify the user
> The identification can be done either using `IterableFlutter.setEmail` or `IterableFlutter.setUserId` methods.
> Don't set an email and user ID in the same session, doing so causes the SDK to treat them as different users.

> The identification can be done either using `IterableFlutter.setEmail` or `IterableFlutter.setUserId` methods.
> Don't set an email and user ID in the same session, doing so causes the SDK to treat them as different users.

4. Call `IterableFlutter.registerForPush` to register the device for current user and listen for opened pushes with `IterableFlutter.setNotificationOpenedHandler`

5. Track your events and optional data fields, call `IterableFlutter.track` method.

### Example

Check the [example/](example/) folder to see an example project using this library.