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.
| Platform | Push | Package |
|---|---|---|
iOS (Swift, iOS 13+) | APNs, no Firebase | VivaPush (CocoaPods), coming soon to the package manager |
Android (Kotlin, minSdk 21) | FCM | com.vivapush:vivapush-android, coming soon to the package manager |
Flutter | APNs and FCM | vivapush_flutter, coming soon to the package manager |
React Native and Expo | APNs and FCM | vivapush-react-native, coming soon to the package manager |
Web | Browsers | Available today with <script>; @vivapush/web coming soon to npm |
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.
platform :ios, '13.0'
target 'MyApp' do
pod 'VivaPush'
end
target 'NotificationService' do
pod 'VivaPush/Extension' # images in notifications (optional)
endimport 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.
dependencies {
implementation("com.vivapush:vivapush-android:0.1.0")
}class MyApp : Application() {
override fun onCreate() {
super.onCreate()
VivaPush.initialize(this, appKey = "vp_pub_YOUR_KEY")
}
}Flutter
dependencies:
vivapush_flutter: ^0.1.0import '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
npm install vivapush-react-nativeimport 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.