File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # OneSignal REST API Key (get from OneSignal dashboard)
2+ REST_API_KEY = your_rest_api_key_here
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ node_modules/
4141npm-debug.log
4242yarn-error.log
4343
44+ # Environment variables
45+ .env
46+ .env.local
47+ .env. * .local
48+
4449# fastlane
4550#
4651# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
Original file line number Diff line number Diff line change 11module . exports = {
22 presets : [ 'module:@react-native/babel-preset' ] ,
3+ plugins : [
4+ [
5+ 'module:react-native-dotenv' ,
6+ {
7+ moduleName : '@env' ,
8+ path : '.env' ,
9+ safe : false ,
10+ allowUndefined : true ,
11+ } ,
12+ ] ,
13+ ] ,
314} ;
Original file line number Diff line number Diff line change 1+ import { REST_API_KEY as ENV_REST_API_KEY } from '@env' ;
2+
13export const APP_ID = '77e32082-ea27-42e3-a898-c72e141824ef' ;
24
35// WARNING: Storing API keys in client code is NOT SAFE for production.
46// In production apps, make API calls from your backend server.
57// This is for demo purposes only.
6- export const REST_API_KEY = '' ; // Replace with your OneSignal REST API Key
8+ export const REST_API_KEY = ENV_REST_API_KEY || '' ;
79export const ONESIGNAL_API_URL = 'https://onesignal.com/api/v1/notifications' ;
Original file line number Diff line number Diff line change 99 "preios" : " bun run setup && bun run update:pod" ,
1010 "android" : " react-native run-android" ,
1111 "ios" : " react-native run-ios" ,
12- "start" : " react-native start"
12+ "start" : " react-native start" ,
13+ "start:fresh" : " react-native start --reset-cache"
1314 },
1415 "dependencies" : {
1516 "@react-native/new-app-screen" : " 0.82.1" ,
3435 "@types/react" : " ^19.2.7" ,
3536 "@types/react-test-renderer" : " ^19.1.0" ,
3637 "prettier" : " 3.7.4" ,
38+ "react-native-dotenv" : " ^3.4.11" ,
3739 "react-test-renderer" : " 19.2.1" ,
3840 "typescript" : " ^5.9.3"
3941 }
Original file line number Diff line number Diff line change 1+ declare module '@env' {
2+ export const REST_API_KEY : string ;
3+ }
You can’t perform that action at this time.
0 commit comments