OneSignal Push Notifications

葡京娱线上开户

OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.

Start for FreeContact Sales

No credit card required

Trusted by 1,004,398 developers

  • LendingTree
  • Volkswagen
  • Verizon
  • Zynga
  • Bose
  • EatStreet
Case Studies
Mike Rome
One of the greatest things about OneSignal is that minimal engineering is required to execute tactics - from personalization and segmenting, to A/B testing, and beyond.

im体育注册

It’s never been easier to connect with customers.

葡京娱线上开户

Our users are always shocked at how easy it is to get started.

葡京娱线上开户

View delivery and conversion performance for every message.

葡京娱线上开户

Millions of users? No problem. We send out billions of notifications daily.

葡京娱线上开户

Compare message performance and automatically send the best.

葡京娱线上开户

Create personalized messages and send them to the right audiences.

葡京娱线上开户

Set it and forget it. You can trigger notifications based on user behavior.

葡京娱线上开户

Leverage machine learning to send your messages at the optimal time.

葡京娱线上开户

Our SDKs are open source and every component is accessible via API.

im体育注册

OneSignal integrates with leading technology companies.

im体育注册

Our founders were app developers first. We couldn’t find any great push notification tools so we built OneSignal.
Code in the language you know with any development environment.

All in less than 10 lines of code.

Apple iOS
import OneSignal

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

  OneSignal.initWithLaunchOptions(launchOptions,
    appId: "YOUR_APP_ID",
    handleNotificationAction: nil,
    settings: [kOSSettingsKeyAutoPrompt: false])

  OneSignal.inFocusDisplayType = OSNotificationDisplayType.notification;

  OneSignal.promptForPushNotifications(userResponse: { accepted in
    print("User accepted notifications: \(accepted)")
  })

  return true
}
Android
import com.onesignal.OneSignal;

public class YourAppClass extends Application {
   @Override
   public void onCreate() {
      super.onCreate();

      OneSignal.startInit(this)
        .inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
        .unsubscribeWhenNotificationsAreDisabled(true)
        .init();
   }
}
Web Push
<head>
  <link rel="manifest" href="/manifest.json">
  <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async></script>
  <script>
    var OneSignal = window.OneSignal || [];
    OneSignal.push(["init", {
      appId: "YOUR_APP_ID"
    }]);
  </script>
</head>
React Native
import OneSignal from 'react-native-onesignal';

export default class App extends Component {
  constructor(properties) {
    super(properties);
    OneSignal.init("YOUR_APP_ID");

    OneSignal.addEventListener('opened', this.onOpened);
  }

  componentWillUnmount() {
    OneSignal.removeEventListener('opened', this.onOpened);
  }

  onOpened(openResult) {
    console.log('Message: ', openResult.notification.payload.body);
    console.log('openResult: ', openResult);
  }
}
Unity
using System.Collections.Generic;

void Start() {
  OneSignal.StartInit("YOUR_APP_ID")
    .HandleNotificationOpened(HandleNotificationOpened)
    .EndInit();

  OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.Notification;
}

private static void HandleNotificationOpened(OSNotificationOpenedResult result) {
  // use notification opened result here
}
Flutter
void main() {
    OneSignal.shared.init("YOUR_APP_ID", {
        OSiOSSettings.autoPrompt: false
    });
    OneSignal.shared.setInFocusDisplayType(OSNotificationDisplayType.notification);

    OneSignal.shared.promptUserForPushNotificationPermission();
}

Code in any language. We provide native support for every development environment.

30+ Platform Integrations