OneSignal Expo Plugin: You have provided an invalid property "appId" to the OneSignal plugin.
 bu hatayı aşamadık bir türlü. kodları atıyorum kontrol et:
// app.config.js
import 'dotenv/config';

export default ({ config }) => ({
  ...config,
  scheme: "myapp", // Unique scheme name
  android: {
    ...config.android,
    useNextNotificationsApi: true, // OneSignal için ek Android ayarı
  },
  plugins: [
    [
      "onesignal-expo-plugin",
      {
        mode: "development", // "development" veya "production" modunu seçin
        appId: "1e50b732-d026-4b7d-91e0-04cb996bee9d", // OneSignal App ID
        // Opsiyonel ayarlar
        // smallIcons: ["./assets/ic_stat_onesignal_default.png"],
        // largeIcons: ["./assets/ic_onesignal_large_icon_default.png"],
        // iosNSEFilePath: "./assets/NotificationService.m",
      }
    ]
  ],
  extra: {
    ...config.extra,
    oneSignalAppId: "1e50b732-d026-4b7d-91e0-04cb996bee9d", // OneSignal App ID
    apiKeyGoogle: process.env.API_KEY_GOOGLE,
    apiKey: process.env.FIREBASE_API_KEY,
    authDomain: process.env.FIREBASE_AUTH_DOMAIN,
    projectId: process.env.FIREBASE_PROJECT_ID,
    storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
    messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
    appId: process.env.FIREBASE_APP_ID,
    apiKeyVoiceRSS: process.env.apiKeyVoiceRSS,
    type: process.env.FIREBASE_TYPE,
    private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID,
    private_key: process.env.FIREBASE_PRIVATE_KEY,
    client_email: process.env.FIREBASE_CLIENT_EMAIL,
    client_id: process.env.FIREBASE_CLIENT_ID,
    auth_uri: process.env.FIREBASE_AUTH_URI,
    token_uri: process.env.FIREBASE_TOKEN_URI,
    auth_provider_x509_cert_url: process.env.FIREBASE_AUTH_PROVIDER_X509_CERT_URL,
    client_x509_cert_url: process.env.FIREBASE_CLIENT_X509_CERT_URL,
    universe_domain: process.env.FIREBASE_UNIVERSE_DOMAIN,
    WEB_CLIENT_ID: process.env.WEB_CLIENT_ID,
    scheme: "myapp", // Scheme should be the same as above
  },
});

// App.js
import React, { useEffect } from 'react';
import Aptabase from "@aptabase/react-native";
import { NavigationContainer } from '@react-navigation/native';
import AppNavigator from './src/navigation/AppNavigator';
import { ThemeAndLanguageProvider, useThemeAndLanguage } from './src/utils/ThemeAndLanguageContext';
import { VocabularyProvider } from './src/screens/VocabularyContext'; 
import { LogBox, Linking } from 'react-native';
import StatusBarManager from './src/components/StatusBarManager'; 
import OneSignal from 'react-native-onesignal';
import { db } from './src/utils/firebase';
import { doc, setDoc, deleteDoc } from 'firebase/firestore';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { HeartProvider } from './src/screens/HeartContext';  // Yeni context dosyasını import et

// OneSignal App ID
const ONE_SIGNAL_APP_ID = "1e50b732-d026-4b7d-91e0-04cb996bee9d";

// Initialize Firebase Analytics
Aptabase.init("A-EU-4450884874"); // Buraya kendi App Key'inizi yazın

// LogBox ile belirli uyarıları gizleme
LogBox.ignoreLogs(['Warning: A props object containing a "key" prop is being spread into JSX']);

// OneSignal push bildirim ayarları
OneSignal.setLogLevel(6, 0);
OneSignal.setAppId(ONE_SIGNAL_APP_ID);

// Uygulama başlatıldığında bildirim izinlerini talep etme
OneSignal.promptForPushNotificationsWithUserResponse(response => {
  console.log("Kullanıcı bildirim izin verdi mi?: ", response);
});

// Bildirim alındığında yapılacak işlemler
OneSignal.setNotificationWillShowInForegroundHandler(notificationReceivedEvent => {
  console.log("Bildirim alındı (foreground): ", notificationReceivedEvent);
  const notification = notificationReceivedEvent.getNotification();
  // Bildirimi kullanıcıya göstermek isterseniz
  notificationReceivedEvent.complete(notification);
});

OneSignal.setNotificationOpenedHandler(notification => {
  console.log("Bildirim açıldı: ", notification);
  const data = notification.notification.additionalData;
  const type = data.type;
  
  if (type === 'update') {
    // Güncelleme bildirimi, Google Play'e yönlendir
    const playStoreUrl = data.url || "https://play.google.com/store/apps/details?id=com.ReadArabic.ReadArabic";
    Linking.openURL(playStoreUrl);
  } else if (data.storyId && navigationRef.current) {
    // Eğer story bildirimiyse, story ekranına yönlendir
    navigationRef.current.navigate('ReadStoryScreen', { storyId: data.storyId });
  }
});

function AppContent() {
  const navigationRef = React.useRef();
  const { locale } = useThemeAndLanguage();

  useEffect(() => {
    // Uygulama başlatma olayını Aptabase'e kaydetme
    Aptabase.trackEvent("app_started", { message: "Uygulama başlatıldı!" });

    // Locale değiştiğinde Firestore'daki locale bilgisini güncelleme
    const updateNotificationLocale = async () => {
      try {
        const userId = await OneSignal.getDeviceState().then(state => state.userId);
        if (userId) {
          await setDoc(doc(db, 'notificationTokens', userId), { locale }, { merge: true });
          console.log('Locale bilgisi Firestore\'a güncellendi.');
        } else {
          console.log('User ID bulunamadı, locale güncellenmedi.');
        }
      } catch (error) {
        console.error('Locale güncelleme hatası:', error);
      }
    };

    updateNotificationLocale();
    
    // Temizleme işlemleri
    return () => {
      // OneSignal otomatik temizleme işlemleri yapar
    };
  }, [locale]);

  return (
    <NavigationContainer ref={navigationRef}>
      <StatusBarManager /> 
      <AppNavigator />
    </NavigationContainer>
  );
}

export default function App() {
  return (
    <ThemeAndLanguageProvider>
      <VocabularyProvider>
        <HeartProvider>
          <AppContent />
        </HeartProvider>
      </VocabularyProvider>
    </ThemeAndLanguageProvider>
  );
}

Google Android (FCM) Configuration
1. Install the SDK
Read our 
React Native / Expo documentation
 to learn how to install the SDK.
Your App ID: 1e50b732-d026-4b7d-91e0-04cb996bee9d
2. Test for Subscribed Users
Build and run your app. The OneSignal SDK, once set up correctly, will automatically handle subscribing your device to notifications.

Check Subscribed Users
We haven't detected any subscribed users yet for this platform. Try some of the tips below or contact us for support.
Run OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.DEBUG);before OneSignal initialization and check your ADB logcat for errors or warnings.
Verify that the OneSignal App ID is correct in your app or site.
1e50b732-d026-4b7d-91e0-04cb996bee9d

expo kullanıyorum expo prebuild yazıyorum bu hatayı alıyorum. 

Jump to Content
OneSignal Documentation
Log In
Sign Up
Home
Guides
Server REST API Reference
Changelog
expo
Quickstart Guide

Channel Setup

Developers

Mobile SDK setup
iOS SDK Setup
Android SDK Setup
Unity SDK Setup
React Native SDK Setup
Expo SDK Setup
Flutter SDK Setup
Ionic/Cordova/Capacitor SDK
.NET MAUI SDK Setup
Amazon SDK Setup
watchOS & Wear OS Support
macOS App Setup
Windows App Setup
Huawei SDK Setup
Android: Firebase Credentials
iOS: p8 Token-Based Connection to APNs
iOS: p12 Generate Certificates
Amazon: Generate an Amazon API Key
Huawei: Authorizing OneSignal

Mobile SDK reference

Web SDK setup
Web SDK reference
REST API Reference

Analytics setup

User Model

Messages

Journeys

Audience

Integrations

Settings & Account Information

Data & Security

Troubleshooting
Expo SDK Setup
Instructions for adding the OneSignal React Native & Expo SDK to your app for iOS, Android, and derivatives like Amazon.

Suggest Edits
📘
Expo Managed Workflow

This documentation shows how to use our SDK with your Expo Managed Workflow application.

If you are using the Bare Workflow, please review the React Native + Expo SDK Setup instead.

Requirements
OneSignal Account
OneSignal App ID, available in Settings > Keys & IDs
iOS Requirements
iOS 11+ or iPadOS 11+ device (iPhone, iPad, iPod Touch) to test on. Xcode 14+ simulator works running iOS 16+
mac with Xcode 12+
p8 Authentication Token or p12 Push Notification Certificate
Your app.json or eas.json or app.config.js file needs the iOS bundleIdentifier property set. See Expo > Configure development and production variants.
Android Requirements
Android 5.0+ device or emulator with "Google Play Store (Services)" installed
Set up your Android Firebase Credentials
Amazon & Huawei Requirements
Follow these instructions if your app is distributed on the Amazon AppStore and/or the Huawei AppGallery.

Generate an Amazon API Key
Huawei Unity SDK Setup
1. Add the OneSignal package to your app
📘
OneSignal Expo Sample App

Sample repo containing the sample app for running OneSignal with Expo.

Make sure you have the Expo CLI installed on your computer.

1.1 Install the OneSignal Expo plugin using the Expo CLI

npx expo install onesignal-expo-plugin

1.2 Install the SDK using Yarn or NPM

Yarn: yarn add react-native-onesignal
NPM npm install --save react-native-onesignal
1.3 Configure your app.json/app.config.js
Add the plugin to the plugin array:

app.json

JSON

{
  "plugins": [
    [
      "onesignal-expo-plugin",
      {
        "mode": "development",
      }
    ]
  ]
}
or

app.config.js

JavaScript

export default {
  ...
  plugins: [
    [
      "onesignal-expo-plugin",
      {
        mode: "development",
      }
    ]
  ]
};
Plugin Prop
You can pass props to the plugin config object to configure:

Plugin Prop		
mode	required	Used to configure APNs environment entitlement. "development" or "production"
devTeam	optional	Used to configure Apple Team ID. You can find your Apple Team ID by running expo credentials:manager e.g: "91SW8A37CR"
iPhoneDeploymentTarget	optional	Target IPHONEOS_DEPLOYMENT_TARGET value to be used when adding the iOS NSE. A deployment target is nothing more than the minimum version of the operating system the application can run on. This value should match the value in your Podfile e.g: "12.0".
smallIcons	optional	An array of local paths to small notification icons for Android. Image should be white, transparent, and 96x96 in size. Input images will be automatically scaled down and placed in the appropriate resource folders. e.g: ["./assets/ic_stat_onesignal_default.png"]. See https://documentation.onesignal.com/docs/customize-notification-icons#small-notification-icons.
largeIcons	optional	An array of local paths to large notification icons for Android. Image should be white, transparent, and 256x256 in size. e.g: ["./assets/ic_onesignal_large_icon_default.png"]. See https://documentation.onesignal.com/docs/customize-notification-icons#large-notification-icons.
iosNSEFilePath	optional	The local path to a custom Notification Service Extension (NSE), written in Objective-C. The NSE will typically start as a copy of the default NSE, then altered to support any custom logic required. e.g: "./assets/NotificationService.m".
1.4 Adding the OneSignal App ID

Add your OneSignal App ID to your Expo constants via the extra param:

JSON

{
  "extra": {
    "oneSignalAppId": "<YOUR APP ID HERE>"
  }
}
You can then access the value to pass to the initialize function:

JavaScript

import { LogLevel, OneSignal } from 'react-native-onesignal';
import Constants from "expo-constants";

OneSignal.Debug.setLogLevel(LogLevel.Verbose);
OneSignal.initialize(Constants.expoConfig.extra.oneSignalAppId);

// Also need enable notifications to complete OneSignal setup
OneSignal.Notifications.requestPermission(true);

Alternatively, pass the OneSignal app ID directly to the function:

JavaScript

OneSignal.initialize("YOUR-ONESIGNAL-APP-ID");
1.5 Run your Expo app

You need to create a development build for your app.

Shell

$ npx expo prebuild

# Build your native iOS project
$ npx expo run:ios

# Build your native Android project
$ npx expo run:android
2. Testing
Run your app on a physical device to make sure it builds correctly.

If you used the provided code, then the requestPermission method, should prompt you to subscribe to push notifications. You can change this later.

Check your OneSignal Dashboard Audience > Subscriptions to see your User & Subscription Record.

Then head over to Messages > New Push to Send your first Push Notification from OneSignal.

Please note that Identity Verification is coming soon to v5 of the Expo SDK.

📘
Troubleshooting

If running into issues, see our Mobile Troubleshooting Guide.

Try our example projects on our Github repository.

If stuck, contact support directly or email <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS> for help.

For faster assistance, please provide:

Your OneSignal App ID
Details, logs, and/or screenshots of the issue.
Steps to reproduce
Recommended
Push permission with In-App Message
You can continue to opt-in users to push via the requestPermission method. However, Apple's Human Interface Guidelines recommends that apps "Create an alert, modal view, or other interface that describes the types of information they want to send and gives people a clear way to opt in or out."

OneSignal provides In-App Messages to meet this recommendation and have a better user experience. This also permits you to ask for permission again in the future, since the native permission prompt is limited to how many times it can show and cannot be shown again if the user clicks deny.

See How to Prompt for Push Permissions with In-App Messages for details on implementing this.



Identify Users
Required if using integrations.
Recommended for messaging across multiple channels (push, email, sms).

OneSignal creates subscription-level records under a unique ID called the subscription_id. A single user can have multiple subscription_id records based on how many devices, email addresses, and phone numbers they use to interact with your app.

If your app has its own login system to track users, call login at any time to link all channels to a single user. For more details, see Aliases & External ID.

JavaScript

let externalId = "123456789" // You will supply the external id to the OneSignal SDK
OneSignal.login(externalId);
Set Email & Phone Number
Recommended for messaging across multiple channels (push, email, sms).

Use the provided SDK methods to capture one or more email/phone numbers for the user. Follow the channel quickstart guides for setup:

Email Quickstart
SMS Quickstart
JavaScript

// Pass in email provided by customer
OneSignal.User.addEmail("example@domain.com");

// Pass in phone number provided by customer
OneSignal.User.addSms("+11234567890");
Add Data Tags
Optional

Tags are custom key : value pairs of String data used for tracking user events and properties. Setting tags is required for more complex segmentation and message personalization.

See Data Tags for more details.
JavaScript

OneSignal.User.addTag("key", "value");
Updated 5 months ago

React Native SDK Setup
Flutter SDK Setup
Did this page help you?
Table of Contents
Requirements
iOS Requirements
Android Requirements
1. Add the OneSignal package to your app
2. Testing
Recommended
Push permission with In-App Message
Identify Users
Set Email & Phone Number
Add Data Tags