Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pushlio React Native SDK

Pushlio push notification SDK — unlimited subscribers, pay per push. pushlio.app

Install

npm install pushlio-react-native @react-native-firebase/app @react-native-firebase/messaging @notifee/react-native @react-native-async-storage/async-storage
cd ios && pod install

(Optional: if react-native-device-info is installed, model/brand are collected automatically.)

Usage

index.js — at the very top (required for Android background messages):

import { Pushlio } from 'pushlio-react-native';
Pushlio.registerBackgroundHandler();

App.tsx:

useEffect(() => {
  Pushlio.init({
    appId: 'YOUR-APP-ID',
    apiUrl: 'https://pushlio.app/api/ingest',
  });
  Pushlio.requestPermission();
  Pushlio.onClick((n) => {
    if (n.effectiveDeepLink) Linking.openURL(n.effectiveDeepLink);
    console.log(n.data); // key-value params
  });
}, []);

Optional:

Pushlio.login('user_42');
Pushlio.setTag('premium', 'true');
Pushlio.trackEvent('level_completed', { level: 5 });
Pushlio.setSubscribed(false); // opt-out

iOS: Notification Service Extension

For "delivered" receipts + big images, create a Notification Service Extension target in Xcode and replace the generated NotificationService.swift with the one shipped in this package: ios/NotificationService.swift. No App Group required.

How it works

  • Android: data-only FCM rendered via notifee (image + up to 3 buttons); delivered/clicked receipts are queued and flushed when online.
  • iOS: alert push shown by the system; the NSE reports the receipt; clicks arrive via onNotificationOpenedApp/getInitialNotification.
  • Only messages marked ph="1" are handled — your app's own FCM traffic is never touched.

Feature Flags & Remote Config

Flip features without a store release — values resolve per device via segments.

if (Pushlio.featureFlag('new_home')) return <NewHome />
const text = Pushlio.remoteConfig('welcome_text', 'Hi')
const limit = Pushlio.remoteConfigNumber('daily_limit', 10)

await Pushlio.syncConfig()                  // manual refresh (e.g. AppState 'active')
Pushlio.onConfigChanged((flags) => setFlags(flags))

Values are cached in AsyncStorage: offline apps keep the last known values. See docs/feature-flags.md.

Publishing

See the repo root guide (maintainers): docs/sdk-yayinlama.md — npm steps.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages