Docs / Apps

App SDKsPackages soon

iOS, Android, Flutter and React Native (with an Expo plugin), with the same API as the web SDK.

Status

The iOS, Android, Flutter and React Native SDKs are ready, with the same API as the web SDK: initialize, requestPermission, login, setAttributes, onNotificationOpened and the rest. Publishing to package managers (CocoaPods, Maven Central, pub.dev and npm) is coming soon; until then, ask for the package at contato@vivapush.com.

PlatformPushPackage
iOS (Swift, iOS 13+)APNs, no FirebaseVivaPush (CocoaPods), coming soon to the package manager
Android (Kotlin, minSdk 21)FCMcom.vivapush:vivapush-android, coming soon to the package manager
FlutterAPNs and FCMvivapush_flutter, coming soon to the package manager
React Native and ExpoAPNs and FCMvivapush-react-native, coming soon to the package manager
WebBrowsersAvailable today with <script>; @vivapush/web coming soon to npm
All of them use the app's public key (vp_pub_…), found under API keys and webhooks in the dashboard. First connect the channels under Channels and credentials: Apple's .p8 key for iOS and the Firebase service account for Android.

iOS

In Xcode, turn on Push Notifications and Background Modes → Remote notifications on the app target. The APNs environment (sandbox or production) is detected automatically.

Podfile (coming soon to the package manager)
platform :ios, '13.0'
target 'MyApp' do
  pod 'VivaPush'
end
target 'NotificationService' do
  pod 'VivaPush/Extension'   # images in notifications (optional)
end
AppDelegate.swift
import VivaPush

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    VivaPush.initialize(appKey: "vp_pub_YOUR_KEY")
    return true
}

Android

Create the Android app in Firebase with the same applicationId, put google-services.json in app/ and apply the com.google.gms.google-services plugin. The SDK receives push through FCM and shows the notification.

app/build.gradle.kts (coming soon to the package manager)
dependencies {
    implementation("com.vivapush:vivapush-android:0.1.0")
}
MyApp.kt
class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        VivaPush.initialize(this, appKey = "vp_pub_YOUR_KEY")
    }
}

Flutter

pubspec.yaml (coming soon to the package manager)
dependencies:
  vivapush_flutter: ^0.1.0
main.dart
import 'package:vivapush_flutter/vivapush_flutter.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await VivaPush.initialize('vp_pub_YOUR_KEY');
  runApp(const MyApp());
}

React Native and Expo

Terminal (coming soon to the package manager)
npm install vivapush-react-native
App.tsx
import VivaPush from 'vivapush-react-native';

VivaPush.initialize('vp_pub_YOUR_KEY');
const status = await VivaPush.requestPermission();

On Expo, use a development build (npx expo prebuild); Expo Go can't run native code. The Expo plugin ships with the package.

Permission and users

Ask for permission when it makes sense to the person, not on the first screen. After sign-in to your product, call login with their ID in your system and, if you like, setAttributes to segment.

Prefer a direct integration? Register the device token at POST /api/v1/devices with the app's public key. The Android and iOS guides show the steps.