├── .gitignore ├── README.md ├── README2.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── trietho │ ├── RNReactNativeABeepModule.java │ └── RNReactNativeABeepPackage.java ├── index.d.ts ├── index.js ├── ios ├── RNReactNativeABeep.h ├── RNReactNativeABeep.m ├── RNReactNativeABeep.podspec ├── RNReactNativeABeep.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── trietho.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── trietho.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── RNReactNativeABeep.xcworkspace │ └── contents.xcworkspacedata ├── mock.js ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-a-beep 2 | A very lite module to play system sounds and beep for react-native apps (no sound files) 3 | 4 | ## Sponsor by 5 | [Go Noter app](https://gonoter.com "Go Noter - Group travel asssistant") - Group travel and expenses assistant! 6 | ## Install 7 | ```javascript 8 | npm install "react-native-a-beep" 9 | ``` 10 | ### (RN < 0.60) Mostly automatic installation 11 | 12 | `$ react-native link react-native-a-beep` 13 | ## Usage 14 | 15 | ```javascript 16 | import RNBeep from 'react-native-a-beep'; 17 | ``` 18 | Examples: 19 | ``` 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | 27 | Happy Beep! 28 | 29 | FREE! -------------------------------------------------------------------------------- /README2.md: -------------------------------------------------------------------------------- 1 | 2 | # react-native-a-beep 3 | A very lite module to play system sounds and beep for react-native apps (no sound files) 4 | ## Sponsor by 5 | [Go Noter app](https://gonoter.com "Go Noter - Group travel asssistant") - Group travel and expenses assistant! 6 | ## Getting started 7 | 8 | `$ npm install react-native-a-beep --save` 9 | 10 | ### (RN < 0.60) Mostly automatic installation 11 | 12 | `$ react-native link react-native-a-beep` 13 | 14 | ### Manual installation 15 | 16 | ### Using CocoaPods 17 | > If the CocoaPods package manager is new to you, please first review 18 | > its [installation guide](https://guides.cocoapods.org/using/getting-started.html) 19 | pod 'RNReactNativeABeep', :path => '../node_modules/react-native-a-beep' 20 | ```ruby 21 | # Uncomment the next line to define a global platform for your project 22 | # platform :ios, '9.0' 23 | 24 | target '_YOUR_PROJECT_TARGET_' do 25 | pod 'RNReactNativeABeep', :path => '../node_modules/react-native-a-beep' 26 | end 27 | ``` 28 | 29 | ```sh 30 | cd ios 31 | pod install 32 | ``` 33 | #### iOS 34 | 35 | 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 36 | 2. Go to `node_modules` ➜ `react-native-a-beep` and add `RNReactNativeABeep.xcodeproj` 37 | 3. In XCode, in the project navigator, select your project. Add `libRNReactNativeABeep.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` 38 | 4. Run your project (`Cmd+R`)< 39 | 40 | #### Android 41 | 42 | 1. Open up `android/app/src/main/java/[...]/MainActivity.java` 43 | - Add `import com.trietho.RNReactNativeABeepPackage;` to the imports at the top of the file 44 | - Add `new RNReactNativeABeepPackage()` to the list returned by the `getPackages()` method 45 | 2. Append the following lines to `android/settings.gradle`: 46 | ``` 47 | include ':react-native-a-beep' 48 | project(':react-native-a-beep').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-a-beep/android') 49 | ``` 50 | 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: 51 | ``` 52 | compile project(':react-native-a-beep') 53 | ``` 54 | 55 | ## Usage 56 | ```javascript 57 | import RNReactNativeABeep from 'react-native-a-beep'; 58 | 59 | // TODO: What to do with the module? 60 | RNReactNativeABeep; 61 | ``` 62 | 63 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | google() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.1.3' 10 | } 11 | } 12 | 13 | apply plugin: 'com.android.library' 14 | 15 | android { 16 | compileSdkVersion 30 17 | buildToolsVersion "28.0.3" 18 | 19 | defaultConfig { 20 | minSdkVersion 21 21 | targetSdkVersion 30 22 | versionCode 1 23 | versionName "1.0" 24 | } 25 | lintOptions { 26 | abortOnError false 27 | } 28 | } 29 | 30 | repositories { 31 | mavenCentral() 32 | google() 33 | } 34 | 35 | dependencies { 36 | implementation 'com.facebook.react:react-native:+' 37 | } 38 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/com/trietho/RNReactNativeABeepModule.java: -------------------------------------------------------------------------------- 1 | 2 | package com.trietho; 3 | 4 | import com.facebook.react.bridge.ReactApplicationContext; 5 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 6 | import com.facebook.react.bridge.ReactMethod; 7 | import com.facebook.react.bridge.Callback; 8 | import android.media.ToneGenerator; 9 | import android.media.AudioManager; 10 | 11 | public class RNReactNativeABeepModule extends ReactContextBaseJavaModule { 12 | 13 | private final ReactApplicationContext reactContext; 14 | private ToneGenerator toneGen1 = new ToneGenerator(AudioManager.STREAM_SYSTEM, 100); 15 | public RNReactNativeABeepModule(ReactApplicationContext reactContext) { 16 | super(reactContext); 17 | this.reactContext = reactContext; 18 | } 19 | 20 | @Override 21 | public String getName() { 22 | return "RNReactNativeABeep"; 23 | } 24 | 25 | @ReactMethod 26 | public void PlaySysSound(int soundID) { 27 | 28 | //toneGen1.startTone(ToneGenerator.TONE_CDMA_PIP,150); 29 | toneGen1.startTone(soundID); 30 | } 31 | 32 | @ReactMethod 33 | public void StopSysSound() { 34 | 35 | //toneGen1.startTone(ToneGenerator.TONE_CDMA_PIP,150); 36 | toneGen1.stopTone(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /android/src/main/java/com/trietho/RNReactNativeABeepPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package com.trietho; 3 | 4 | import java.util.Arrays; 5 | import java.util.Collections; 6 | import java.util.List; 7 | 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.bridge.NativeModule; 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.uimanager.ViewManager; 12 | import com.facebook.react.bridge.JavaScriptModule; 13 | public class RNReactNativeABeepPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNReactNativeABeepModule(reactContext)); 17 | } 18 | 19 | // Deprecated from RN 0.47 20 | public List> createJSModules() { 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Override 25 | public List createViewManagers(ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | declare class RNBeep { 2 | static beep(success?: boolean): void 3 | 4 | static PlaySysSound(soundID: number): void 5 | 6 | static AndroidSoundIDs: { 7 | TONE_CDMA_ABBR_ALERT: number, 8 | TONE_CDMA_ABBR_INTERCEPT: number, 9 | TONE_CDMA_ABBR_REORDER: number, 10 | TONE_CDMA_ALERT_AUTOREDIAL_LITE: number, 11 | TONE_CDMA_ALERT_CALL_GUARD: number, 12 | TONE_CDMA_ALERT_INCALL_LITE: number, 13 | TONE_CDMA_ALERT_NETWORK_LITE: number, 14 | TONE_CDMA_ANSWER: number, 15 | TONE_CDMA_CALLDROP_LITE: number, 16 | TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP: number, 17 | TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL: number, 18 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT3: number, 19 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT5: number, 20 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT6: number, 21 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT7: number, 22 | TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING: number, 23 | TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI: number, 24 | TONE_CDMA_CONFIRM: number, 25 | TONE_CDMA_DIAL_TONE_LITE: number, 26 | TONE_CDMA_EMERGENCY_RINGBACK: number, 27 | TONE_CDMA_HIGH_L: number, 28 | TONE_CDMA_HIGH_PBX_L: number, 29 | TONE_CDMA_HIGH_PBX_SLS: number, 30 | TONE_CDMA_HIGH_PBX_SS: number, 31 | TONE_CDMA_HIGH_PBX_SSL: number, 32 | TONE_CDMA_HIGH_PBX_S_X4: number, 33 | TONE_CDMA_HIGH_SLS: number, 34 | TONE_CDMA_HIGH_SS: number, 35 | TONE_CDMA_HIGH_SSL: number, 36 | TONE_CDMA_HIGH_SS_2: number, 37 | TONE_CDMA_HIGH_S_X4: number, 38 | TONE_CDMA_INTERCEPT: number, 39 | TONE_CDMA_KEYPAD_VOLUME_KEY_LITE: number, 40 | TONE_CDMA_LOW_L: number, 41 | TONE_CDMA_LOW_PBX_L: number, 42 | TONE_CDMA_LOW_PBX_SLS: number, 43 | TONE_CDMA_LOW_PBX_SS: number, 44 | TONE_CDMA_LOW_PBX_SSL: number, 45 | TONE_CDMA_LOW_PBX_S_X4: number, 46 | TONE_CDMA_LOW_SLS: number, 47 | TONE_CDMA_LOW_SS: number, 48 | TONE_CDMA_LOW_SSL: number, 49 | TONE_CDMA_LOW_SS_2: number, 50 | TONE_CDMA_LOW_S_X4: number, 51 | TONE_CDMA_MED_L: number, 52 | TONE_CDMA_MED_PBX_L: number, 53 | TONE_CDMA_MED_PBX_SLS: number, 54 | TONE_CDMA_MED_PBX_SS: number, 55 | TONE_CDMA_MED_PBX_SSL: number, 56 | TONE_CDMA_MED_PBX_S_X4: number, 57 | TONE_CDMA_MED_SLS: number, 58 | TONE_CDMA_MED_SS: number, 59 | TONE_CDMA_MED_SSL: number, 60 | TONE_CDMA_MED_SS_2: number, 61 | TONE_CDMA_MED_S_X4: number, 62 | TONE_CDMA_NETWORK_BUSY: number, 63 | TONE_CDMA_NETWORK_BUSY_ONE_SHOT: number, 64 | TONE_CDMA_NETWORK_CALLWAITING: number, 65 | TONE_CDMA_NETWORK_USA_RINGBACK: number, 66 | TONE_CDMA_ONE_MIN_BEEP: number, 67 | TONE_CDMA_PIP: number, 68 | TONE_CDMA_PRESSHOLDKEY_LITE: number, 69 | TONE_CDMA_REORDER: number, 70 | TONE_CDMA_SIGNAL_OFF: number, 71 | TONE_CDMA_SOFT_ERROR_LITE: number, 72 | TONE_DTMF_0: number, 73 | TONE_DTMF_1: number, 74 | TONE_DTMF_2: number, 75 | TONE_DTMF_3: number, 76 | TONE_DTMF_4: number, 77 | TONE_DTMF_5: number, 78 | TONE_DTMF_6: number, 79 | TONE_DTMF_7: number, 80 | TONE_DTMF_8: number, 81 | TONE_DTMF_9: number, 82 | TONE_DTMF_A: number, 83 | TONE_DTMF_B: number, 84 | TONE_DTMF_C: number, 85 | TONE_DTMF_D: number, 86 | TONE_DTMF_P: number, 87 | TONE_DTMF_S: number, 88 | TONE_PROP_ACK: number, 89 | TONE_PROP_BEEP: number, 90 | TONE_PROP_BEEP2: number, 91 | TONE_PROP_NACK: number, 92 | TONE_PROP_PROMPT: number, 93 | TONE_SUP_BUSY: number, 94 | TONE_SUP_CALL_WAITING: number, 95 | TONE_SUP_CONFIRM: number, 96 | TONE_SUP_CONGESTION: number, 97 | TONE_SUP_CONGESTION_ABBREV: number, 98 | TONE_SUP_DIAL: number, 99 | TONE_SUP_ERROR: number, 100 | TONE_SUP_INTERCEPT: number, 101 | TONE_SUP_INTERCEPT_ABBREV: number, 102 | TONE_SUP_PIP: number, 103 | TONE_SUP_RADIO_ACK: number, 104 | TONE_SUP_RADIO_NOTAVAIL: number, 105 | TONE_SUP_RINGTONE: number 106 | }; 107 | 108 | static iOSSoundIDs: { 109 | MailReceived: number, 110 | MailSent: number, 111 | VoicemailReceived: number, 112 | SMSReceived: number, 113 | CalendarAlert: number, 114 | LowPower: number, 115 | SMSReceived_Alert1: number, 116 | SMSReceived_Alert2: number, 117 | SMSReceived_Alert3: number, 118 | SMSReceived_Alert4: number, 119 | SMSReceived_Vibrate: number, 120 | SMSReceived_Alert5: number, 121 | SMSReceived_Alert6: number, 122 | SMSReceived_Alert7: number, 123 | Voicemail: number, 124 | SMSSent: number, 125 | SMSReceived_Alert8: number, 126 | SMSReceived_Alert9: number, 127 | SMSReceived_Alert10: number, 128 | SMSReceived_Alert11: number, 129 | SMSReceived_Alert12: number, 130 | SMSReceived_Alert13: number, 131 | SMSReceived_Alert14: number, 132 | SMSReceived_Alert15: number, 133 | SMSReceived_Alert16: number, 134 | SMSReceived_Alert17: number, 135 | USSDAlert: number, 136 | SIMToolkitTone1: number, 137 | SIMToolkitTone2: number, 138 | SIMToolkitTone3: number, 139 | SIMToolkitTone4: number, 140 | PINKeyPressed: number, 141 | AudioToneBusy: number, 142 | AudioToneCongestion: number, 143 | AudioTonePathAcknowledge: number, 144 | AudioToneError: number, 145 | AudioToneCallWaiting: number, 146 | AudioToneKey2: number, 147 | ScreenLocked: number, 148 | ScreenUnlocked: number, 149 | FailedUnlock: number, 150 | KeyPressed1: number, 151 | KeyPressed2: number, 152 | KeyPressed3: number, 153 | ConnectedToPower: number, 154 | RingerSwitchIndication: number, 155 | CameraShutter: number, 156 | ShakeToShuffle: number, 157 | JBL_Begin: number, 158 | JBL_Confirm: number, 159 | JBL_Cancel: number, 160 | BeginRecording: number, 161 | EndRecording: number, 162 | JBL_Ambiguous: number, 163 | JBL_NoMatch: number, 164 | BeginVideoRecording: number, 165 | EndVideoRecording: number, 166 | VCInvitationAccepted: number, 167 | VCRinging: number, 168 | VCEnded: number, 169 | VCCallWaiting: number, 170 | VCCallUpgrade: number, 171 | TouchTone1: number, 172 | TouchTone2: number, 173 | TouchTone3: number, 174 | TouchTone4: number, 175 | TouchTone5: number, 176 | TouchTone6: number, 177 | TouchTone7: number, 178 | TouchTone8: number, 179 | TouchTone9: number, 180 | TouchTone10: number, 181 | TouchTone11: number, 182 | TouchTone12: number, 183 | Headset_StartCall: number, 184 | Headset_Redial: number, 185 | Headset_AnswerCall: number, 186 | Headset_EndCall: number, 187 | Headset_CallWaitingActions: number, 188 | Headset_TransitionEnd: number, 189 | SystemSoundPreview1: number, 190 | SystemSoundPreview2: number, 191 | SystemSoundPreview3: number, 192 | SystemSoundPreview4: number, 193 | SystemSoundPreview5: number, 194 | SystemSoundPreview6: number, 195 | KeyPressClickPreview: number, 196 | SMSReceived_Selection1: number, 197 | SMSReceived_Selection2: number, 198 | SMSReceived_Selection3: number, 199 | SMSReceived_Selection4: number, 200 | SMSReceived_Selection5: number, 201 | SMSReceived_Selection6: number, 202 | SMSReceived_Selection7: number, 203 | SystemSoundPreview: number, 204 | SMSReceived_Selection8: number, 205 | SMSReceived_Selection9: number, 206 | SMSReceived_Selection10: number, 207 | SMSReceived_Selection11: number, 208 | SMSReceived_Selection12: number, 209 | SMSReceived_Selection13: number, 210 | SMSReceived_Selection14: number, 211 | SMSReceived_Selection15: number, 212 | SMSReceived_Selection16: number, 213 | SMSReceived_Selection17: number, 214 | SMSReceived_Selection18: number, 215 | SMSReceived_Selection19: number, 216 | SMSReceived_Selection20: number, 217 | SMSReceived_Selection21: number, 218 | SMSReceived_Selection22: number, 219 | SMSReceived_Selection23: number, 220 | SMSReceived_Selection24: number, 221 | RingerVibeChanged: number, 222 | SilentVibeChanged: number, 223 | Vibrate: number 224 | }; 225 | } 226 | 227 | 228 | export default RNBeep; 229 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | import { NativeModules, Platform } from 'react-native'; 3 | 4 | const RNReactNativeABeep = NativeModules.RNReactNativeABeep; 5 | 6 | class RNBeep { 7 | // some fancy code here 8 | static beep(success){ 9 | var soundID = Platform.select({ 10 | ios: (success == false)? 1257: 1256, 11 | android: (success == false)? 25: 24 12 | }); 13 | 14 | this.PlaySysSound(soundID); 15 | 16 | } 17 | 18 | static PlaySysSound(soundID) { 19 | if (Platform.OS == "android") 20 | RNReactNativeABeep.StopSysSound(); 21 | RNReactNativeABeep.PlaySysSound(soundID); 22 | } 23 | 24 | static AndroidSoundIDs = { 25 | TONE_CDMA_ABBR_ALERT : 97, 26 | TONE_CDMA_ABBR_INTERCEPT : 37, 27 | TONE_CDMA_ABBR_REORDER : 39, 28 | TONE_CDMA_ALERT_AUTOREDIAL_LITE : 87, 29 | TONE_CDMA_ALERT_CALL_GUARD : 93, 30 | TONE_CDMA_ALERT_INCALL_LITE : 91, 31 | TONE_CDMA_ALERT_NETWORK_LITE : 86, 32 | TONE_CDMA_ANSWER : 42, 33 | TONE_CDMA_CALLDROP_LITE : 95, 34 | TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP : 46, 35 | TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL : 45, 36 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT3 : 48, 37 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT5 : 50, 38 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT6 : 51, 39 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT7 : 52, 40 | TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING : 49, 41 | TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI : 47, 42 | TONE_CDMA_CONFIRM : 41, 43 | TONE_CDMA_DIAL_TONE_LITE : 34, 44 | TONE_CDMA_EMERGENCY_RINGBACK : 92, 45 | TONE_CDMA_HIGH_L : 53, 46 | TONE_CDMA_HIGH_PBX_L : 71, 47 | TONE_CDMA_HIGH_PBX_SLS : 80, 48 | TONE_CDMA_HIGH_PBX_SS : 74, 49 | TONE_CDMA_HIGH_PBX_SSL : 77, 50 | TONE_CDMA_HIGH_PBX_S_X4 : 83, 51 | TONE_CDMA_HIGH_SLS : 65, 52 | TONE_CDMA_HIGH_SS : 56, 53 | TONE_CDMA_HIGH_SSL : 59, 54 | TONE_CDMA_HIGH_SS_2 : 62, 55 | TONE_CDMA_HIGH_S_X4 : 68, 56 | TONE_CDMA_INTERCEPT : 36, 57 | TONE_CDMA_KEYPAD_VOLUME_KEY_LITE : 89, 58 | TONE_CDMA_LOW_L : 55, 59 | TONE_CDMA_LOW_PBX_L : 73, 60 | TONE_CDMA_LOW_PBX_SLS : 82, 61 | TONE_CDMA_LOW_PBX_SS : 76, 62 | TONE_CDMA_LOW_PBX_SSL : 79, 63 | TONE_CDMA_LOW_PBX_S_X4 : 85, 64 | TONE_CDMA_LOW_SLS : 67, 65 | TONE_CDMA_LOW_SS : 58, 66 | TONE_CDMA_LOW_SSL : 61, 67 | TONE_CDMA_LOW_SS_2 : 64, 68 | TONE_CDMA_LOW_S_X4 : 70, 69 | TONE_CDMA_MED_L : 54, 70 | TONE_CDMA_MED_PBX_L : 72, 71 | TONE_CDMA_MED_PBX_SLS : 81, 72 | TONE_CDMA_MED_PBX_SS : 75, 73 | TONE_CDMA_MED_PBX_SSL : 78, 74 | TONE_CDMA_MED_PBX_S_X4 : 84, 75 | TONE_CDMA_MED_SLS : 66, 76 | TONE_CDMA_MED_SS : 57, 77 | TONE_CDMA_MED_SSL : 60, 78 | TONE_CDMA_MED_SS_2 : 63, 79 | TONE_CDMA_MED_S_X4 : 69, 80 | TONE_CDMA_NETWORK_BUSY : 40, 81 | TONE_CDMA_NETWORK_BUSY_ONE_SHOT : 96, 82 | TONE_CDMA_NETWORK_CALLWAITING : 43, 83 | TONE_CDMA_NETWORK_USA_RINGBACK : 35, 84 | TONE_CDMA_ONE_MIN_BEEP : 88, 85 | TONE_CDMA_PIP : 44, 86 | TONE_CDMA_PRESSHOLDKEY_LITE : 90, 87 | TONE_CDMA_REORDER : 38, 88 | TONE_CDMA_SIGNAL_OFF : 98, 89 | TONE_CDMA_SOFT_ERROR_LITE : 94, 90 | TONE_DTMF_0 : 0, 91 | TONE_DTMF_1 : 1, 92 | TONE_DTMF_2 : 2, 93 | TONE_DTMF_3 : 3, 94 | TONE_DTMF_4 : 4, 95 | TONE_DTMF_5 : 5, 96 | TONE_DTMF_6 : 6, 97 | TONE_DTMF_7 : 7, 98 | TONE_DTMF_8 : 8, 99 | TONE_DTMF_9 : 9, 100 | TONE_DTMF_A : 12, 101 | TONE_DTMF_B : 13, 102 | TONE_DTMF_C : 14, 103 | TONE_DTMF_D : 15, 104 | TONE_DTMF_P : 11, 105 | TONE_DTMF_S : 10, 106 | TONE_PROP_ACK : 25, 107 | TONE_PROP_BEEP : 24, 108 | TONE_PROP_BEEP2 : 28, 109 | TONE_PROP_NACK : 26, 110 | TONE_PROP_PROMPT : 27, 111 | TONE_SUP_BUSY : 17, 112 | TONE_SUP_CALL_WAITING : 22, 113 | TONE_SUP_CONFIRM : 32, 114 | TONE_SUP_CONGESTION : 18, 115 | TONE_SUP_CONGESTION_ABBREV : 31, 116 | TONE_SUP_DIAL : 16, 117 | TONE_SUP_ERROR : 21, 118 | TONE_SUP_INTERCEPT : 29, 119 | TONE_SUP_INTERCEPT_ABBREV : 30, 120 | TONE_SUP_PIP : 33, 121 | TONE_SUP_RADIO_ACK : 19, 122 | TONE_SUP_RADIO_NOTAVAIL : 20, 123 | TONE_SUP_RINGTONE : 23 124 | }; 125 | 126 | static iOSSoundIDs = { 127 | MailReceived : 1000, 128 | MailSent : 1001, 129 | VoicemailReceived : 1002, 130 | SMSReceived : 1003, 131 | SMSSent : 1004, 132 | CalendarAlert : 1005, 133 | LowPower : 1006, 134 | SMSReceived_Alert1 : 1007, 135 | SMSReceived_Alert2 : 1008, 136 | SMSReceived_Alert3 : 1009, 137 | SMSReceived_Alert4 : 1010, 138 | SMSReceived_Vibrate : 1011, 139 | SMSReceived_Alert5 : 1012, 140 | SMSReceived_Alert6 : 1013, 141 | SMSReceived_Alert7 : 1014, 142 | Voicemail : 1015, 143 | SMSSent : 1016, 144 | SMSReceived_Alert1 : 1020, 145 | SMSReceived_Alert2 : 1021, 146 | SMSReceived_Alert3 : 1022, 147 | SMSReceived_Alert4 : 1023, 148 | SMSReceived_Alert5 : 1024, 149 | SMSReceived_Alert6 : 1025, 150 | SMSReceived_Alert7 : 1026, 151 | SMSReceived_Alert8 : 1027, 152 | SMSReceived_Alert9 : 1028, 153 | SMSReceived_Alert10 : 1029, 154 | SMSReceived_Alert11 : 1030, 155 | SMSReceived_Alert12 : 1031, 156 | SMSReceived_Alert13 : 1032, 157 | SMSReceived_Alert14 : 1033, 158 | SMSReceived_Alert15 : 1034, 159 | SMSReceived_Alert16 : 1035, 160 | SMSReceived_Alert17 : 1036, 161 | USSDAlert : 1050, 162 | SIMToolkitTone1 : 1051, 163 | SIMToolkitTone2 : 1052, 164 | SIMToolkitTone3 : 1053, 165 | SIMToolkitTone4 : 1054, 166 | SIMToolkitTone4 : 1055, 167 | PINKeyPressed : 1057, 168 | AudioToneBusy : 1070, 169 | AudioToneCongestion : 1071, 170 | AudioTonePathAcknowledge : 1072, 171 | AudioToneError : 1073, 172 | AudioToneCallWaiting : 1074, 173 | AudioToneKey2 : 1075, 174 | ScreenLocked : 1100, 175 | ScreenUnlocked : 1101, 176 | FailedUnlock : 1102, 177 | KeyPressed1 : 1103, 178 | KeyPressed2 : 1104, 179 | KeyPressed3 : 1105, 180 | ConnectedToPower : 1106, 181 | RingerSwitchIndication : 1107, 182 | CameraShutter : 1108, 183 | ShakeToShuffle : 1109, 184 | JBL_Begin : 1110, 185 | JBL_Confirm : 1111, 186 | JBL_Cancel : 1112, 187 | BeginRecording : 1113, 188 | EndRecording : 1114, 189 | JBL_Ambiguous : 1115, 190 | JBL_NoMatch : 1116, 191 | BeginVideoRecording : 1117, 192 | EndVideoRecording : 1118, 193 | VCInvitationAccepted : 1150, 194 | VCRinging : 1151, 195 | VCEnded : 1152, 196 | VCCallWaiting : 1153, 197 | VCCallUpgrade : 1154, 198 | TouchTone1 : 1200, 199 | TouchTone2 : 1201, 200 | TouchTone3 : 1202, 201 | TouchTone4 : 1203, 202 | TouchTone5 : 1204, 203 | TouchTone6 : 1205, 204 | TouchTone7 : 1206, 205 | TouchTone8 : 1207, 206 | TouchTone9 : 1208, 207 | TouchTone10 : 1209, 208 | TouchTone11 : 1210, 209 | TouchTone12 : 1211, 210 | Headset_StartCall : 1254, 211 | Headset_Redial : 1255, 212 | Headset_AnswerCall : 1256, 213 | Headset_EndCall : 1257, 214 | Headset_CallWaitingActions : 1258, 215 | Headset_TransitionEnd : 1259, 216 | SystemSoundPreview1 : 1300, 217 | SystemSoundPreview2 : 1301, 218 | SystemSoundPreview3 : 1302, 219 | SystemSoundPreview4 : 1303, 220 | SystemSoundPreview5 : 1304, 221 | SystemSoundPreview6 : 1305, 222 | KeyPressClickPreview : 1306, 223 | SMSReceived_Selection1 : 1307, 224 | SMSReceived_Selection2 : 1308, 225 | SMSReceived_Selection3 : 1309, 226 | SMSReceived_Selection4 : 1310, 227 | SMSReceived_Vibrate : 1311, 228 | SMSReceived_Selection5 : 1312, 229 | SMSReceived_Selection6 : 1313, 230 | SMSReceived_Selection7 : 1314, 231 | SystemSoundPreview : 1315, 232 | SMSReceived_Selection8 : 1320, 233 | SMSReceived_Selection9 : 1321, 234 | SMSReceived_Selection10 : 1322, 235 | SMSReceived_Selection11 : 1323, 236 | SMSReceived_Selection12 : 1324, 237 | SMSReceived_Selection13 : 1325, 238 | SMSReceived_Selection14 : 1326, 239 | SMSReceived_Selection15 : 1327, 240 | SMSReceived_Selection16 : 1328, 241 | SMSReceived_Selection17 : 1329, 242 | SMSReceived_Selection18 : 1330, 243 | SMSReceived_Selection19 : 1331, 244 | SMSReceived_Selection20 : 1332, 245 | SMSReceived_Selection21 : 1333, 246 | SMSReceived_Selection22 : 1334, 247 | SMSReceived_Selection23 : 1335, 248 | SMSReceived_Selection24 : 1336, 249 | RingerVibeChanged : 1350, 250 | SilentVibeChanged : 1351, 251 | Vibrate : 4095 252 | }; 253 | } 254 | 255 | 256 | export default RNBeep; 257 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.h: -------------------------------------------------------------------------------- 1 | 2 | #if __has_include("RCTBridgeModule.h") 3 | #import "RCTBridgeModule.h" 4 | #else 5 | #import 6 | #endif 7 | 8 | @interface RNReactNativeABeep : NSObject 9 | 10 | @end 11 | 12 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.m: -------------------------------------------------------------------------------- 1 | 2 | #import "RNReactNativeABeep.h" 3 | #import 4 | 5 | @implementation RNReactNativeABeep 6 | 7 | - (dispatch_queue_t)methodQueue 8 | { 9 | return dispatch_get_main_queue(); 10 | } 11 | 12 | RCT_EXPORT_MODULE() 13 | 14 | RCT_EXPORT_METHOD(PlaySysSound: (nonnull NSInteger *) soundID){ 15 | 16 | AudioServicesPlaySystemSound (soundID); 17 | } 18 | 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = "RNReactNativeABeep" 4 | s.version = "1.0.4" 5 | s.summary = "Play system sounds" 6 | s.description = <<-DESC 7 | RNReactNativeABeep 8 | DESC 9 | s.homepage = "https://github.com/trietho/react-native-a-beep.git" 10 | s.license = "FREE" 11 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 12 | s.author = { "author" => "trietho@gmail.com" } 13 | s.platform = :ios, "7.0" 14 | s.source = { :git => "https://github.com/trietho/react-native-a-beep.git", :tag => "master" } 15 | s.source_files = "**/*.{h,m}" 16 | s.requires_arc = true 17 | 18 | 19 | s.dependency "React" 20 | #s.dependency "others" 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AFC68F0621987EE8000AEB35 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AFC68F0521987EE8000AEB35 /* AudioToolbox.framework */; }; 11 | B3E7B58A1CC2AC0600A0062D /* RNReactNativeABeep.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNReactNativeABeep.m */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = "include/$(PRODUCT_NAME)"; 19 | dstSubfolderSpec = 16; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 0; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 134814201AA4EA6300B7C361 /* libRNReactNativeABeep.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNReactNativeABeep.a; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | AFC68F0521987EE8000AEB35 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 29 | B3E7B5881CC2AC0600A0062D /* RNReactNativeABeep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNReactNativeABeep.h; sourceTree = ""; }; 30 | B3E7B5891CC2AC0600A0062D /* RNReactNativeABeep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNReactNativeABeep.m; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | AFC68F0621987EE8000AEB35 /* AudioToolbox.framework in Frameworks */, 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 134814211AA4EA7D00B7C361 /* Products */ = { 46 | isa = PBXGroup; 47 | children = ( 48 | 134814201AA4EA6300B7C361 /* libRNReactNativeABeep.a */, 49 | ); 50 | name = Products; 51 | sourceTree = ""; 52 | }; 53 | 58B511D21A9E6C8500147676 = { 54 | isa = PBXGroup; 55 | children = ( 56 | B3E7B5881CC2AC0600A0062D /* RNReactNativeABeep.h */, 57 | B3E7B5891CC2AC0600A0062D /* RNReactNativeABeep.m */, 58 | 134814211AA4EA7D00B7C361 /* Products */, 59 | AFC68F0421987EE8000AEB35 /* Frameworks */, 60 | ); 61 | sourceTree = ""; 62 | }; 63 | AFC68F0421987EE8000AEB35 /* Frameworks */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | AFC68F0521987EE8000AEB35 /* AudioToolbox.framework */, 67 | ); 68 | name = Frameworks; 69 | sourceTree = ""; 70 | }; 71 | /* End PBXGroup section */ 72 | 73 | /* Begin PBXNativeTarget section */ 74 | 58B511DA1A9E6C8500147676 /* RNReactNativeABeep */ = { 75 | isa = PBXNativeTarget; 76 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNReactNativeABeep" */; 77 | buildPhases = ( 78 | 58B511D71A9E6C8500147676 /* Sources */, 79 | 58B511D81A9E6C8500147676 /* Frameworks */, 80 | 58B511D91A9E6C8500147676 /* CopyFiles */, 81 | ); 82 | buildRules = ( 83 | ); 84 | dependencies = ( 85 | ); 86 | name = RNReactNativeABeep; 87 | productName = RCTDataManager; 88 | productReference = 134814201AA4EA6300B7C361 /* libRNReactNativeABeep.a */; 89 | productType = "com.apple.product-type.library.static"; 90 | }; 91 | /* End PBXNativeTarget section */ 92 | 93 | /* Begin PBXProject section */ 94 | 58B511D31A9E6C8500147676 /* Project object */ = { 95 | isa = PBXProject; 96 | attributes = { 97 | LastUpgradeCheck = 0830; 98 | ORGANIZATIONNAME = Facebook; 99 | TargetAttributes = { 100 | 58B511DA1A9E6C8500147676 = { 101 | CreatedOnToolsVersion = 6.1.1; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNReactNativeABeep" */; 106 | compatibilityVersion = "Xcode 3.2"; 107 | developmentRegion = English; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | ); 112 | mainGroup = 58B511D21A9E6C8500147676; 113 | productRefGroup = 58B511D21A9E6C8500147676; 114 | projectDirPath = ""; 115 | projectRoot = ""; 116 | targets = ( 117 | 58B511DA1A9E6C8500147676 /* RNReactNativeABeep */, 118 | ); 119 | }; 120 | /* End PBXProject section */ 121 | 122 | /* Begin PBXSourcesBuildPhase section */ 123 | 58B511D71A9E6C8500147676 /* Sources */ = { 124 | isa = PBXSourcesBuildPhase; 125 | buildActionMask = 2147483647; 126 | files = ( 127 | B3E7B58A1CC2AC0600A0062D /* RNReactNativeABeep.m in Sources */, 128 | ); 129 | runOnlyForDeploymentPostprocessing = 0; 130 | }; 131 | /* End PBXSourcesBuildPhase section */ 132 | 133 | /* Begin XCBuildConfiguration section */ 134 | 58B511ED1A9E6C8500147676 /* Debug */ = { 135 | isa = XCBuildConfiguration; 136 | buildSettings = { 137 | ALWAYS_SEARCH_USER_PATHS = NO; 138 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 139 | CLANG_CXX_LIBRARY = "libc++"; 140 | CLANG_ENABLE_MODULES = YES; 141 | CLANG_ENABLE_OBJC_ARC = YES; 142 | CLANG_WARN_BOOL_CONVERSION = YES; 143 | CLANG_WARN_CONSTANT_CONVERSION = YES; 144 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 145 | CLANG_WARN_EMPTY_BODY = YES; 146 | CLANG_WARN_ENUM_CONVERSION = YES; 147 | CLANG_WARN_INFINITE_RECURSION = YES; 148 | CLANG_WARN_INT_CONVERSION = YES; 149 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 150 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 151 | CLANG_WARN_UNREACHABLE_CODE = YES; 152 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 153 | COPY_PHASE_STRIP = NO; 154 | ENABLE_STRICT_OBJC_MSGSEND = YES; 155 | ENABLE_TESTABILITY = YES; 156 | GCC_C_LANGUAGE_STANDARD = gnu99; 157 | GCC_DYNAMIC_NO_PIC = NO; 158 | GCC_NO_COMMON_BLOCKS = YES; 159 | GCC_OPTIMIZATION_LEVEL = 0; 160 | GCC_PREPROCESSOR_DEFINITIONS = ( 161 | "DEBUG=1", 162 | "$(inherited)", 163 | ); 164 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 165 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 166 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 167 | GCC_WARN_UNDECLARED_SELECTOR = YES; 168 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 169 | GCC_WARN_UNUSED_FUNCTION = YES; 170 | GCC_WARN_UNUSED_VARIABLE = YES; 171 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 172 | MTL_ENABLE_DEBUG_INFO = YES; 173 | ONLY_ACTIVE_ARCH = YES; 174 | SDKROOT = iphoneos; 175 | }; 176 | name = Debug; 177 | }; 178 | 58B511EE1A9E6C8500147676 /* Release */ = { 179 | isa = XCBuildConfiguration; 180 | buildSettings = { 181 | ALWAYS_SEARCH_USER_PATHS = NO; 182 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 183 | CLANG_CXX_LIBRARY = "libc++"; 184 | CLANG_ENABLE_MODULES = YES; 185 | CLANG_ENABLE_OBJC_ARC = YES; 186 | CLANG_WARN_BOOL_CONVERSION = YES; 187 | CLANG_WARN_CONSTANT_CONVERSION = YES; 188 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 189 | CLANG_WARN_EMPTY_BODY = YES; 190 | CLANG_WARN_ENUM_CONVERSION = YES; 191 | CLANG_WARN_INFINITE_RECURSION = YES; 192 | CLANG_WARN_INT_CONVERSION = YES; 193 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 194 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | COPY_PHASE_STRIP = YES; 198 | ENABLE_NS_ASSERTIONS = NO; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | GCC_C_LANGUAGE_STANDARD = gnu99; 201 | GCC_NO_COMMON_BLOCKS = YES; 202 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 203 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 204 | GCC_WARN_UNDECLARED_SELECTOR = YES; 205 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 206 | GCC_WARN_UNUSED_FUNCTION = YES; 207 | GCC_WARN_UNUSED_VARIABLE = YES; 208 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 209 | MTL_ENABLE_DEBUG_INFO = NO; 210 | SDKROOT = iphoneos; 211 | VALIDATE_PRODUCT = YES; 212 | }; 213 | name = Release; 214 | }; 215 | 58B511F01A9E6C8500147676 /* Debug */ = { 216 | isa = XCBuildConfiguration; 217 | buildSettings = { 218 | HEADER_SEARCH_PATHS = ( 219 | "$(inherited)", 220 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 221 | "$(SRCROOT)/../../../React/**", 222 | "$(SRCROOT)/../../react-native/React/**", 223 | ); 224 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 225 | OTHER_LDFLAGS = "-ObjC"; 226 | PRODUCT_NAME = RNReactNativeABeep; 227 | SKIP_INSTALL = YES; 228 | }; 229 | name = Debug; 230 | }; 231 | 58B511F11A9E6C8500147676 /* Release */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | HEADER_SEARCH_PATHS = ( 235 | "$(inherited)", 236 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 237 | "$(SRCROOT)/../../../React/**", 238 | "$(SRCROOT)/../../react-native/React/**", 239 | ); 240 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 241 | OTHER_LDFLAGS = "-ObjC"; 242 | PRODUCT_NAME = RNReactNativeABeep; 243 | SKIP_INSTALL = YES; 244 | }; 245 | name = Release; 246 | }; 247 | /* End XCBuildConfiguration section */ 248 | 249 | /* Begin XCConfigurationList section */ 250 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNReactNativeABeep" */ = { 251 | isa = XCConfigurationList; 252 | buildConfigurations = ( 253 | 58B511ED1A9E6C8500147676 /* Debug */, 254 | 58B511EE1A9E6C8500147676 /* Release */, 255 | ); 256 | defaultConfigurationIsVisible = 0; 257 | defaultConfigurationName = Release; 258 | }; 259 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNReactNativeABeep" */ = { 260 | isa = XCConfigurationList; 261 | buildConfigurations = ( 262 | 58B511F01A9E6C8500147676 /* Debug */, 263 | 58B511F11A9E6C8500147676 /* Release */, 264 | ); 265 | defaultConfigurationIsVisible = 0; 266 | defaultConfigurationName = Release; 267 | }; 268 | /* End XCConfigurationList section */ 269 | }; 270 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 271 | } 272 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.xcodeproj/project.xcworkspace/xcuserdata/trietho.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trietho/react-native-a-beep/408bfdbf8f9fdb13cc9883fa481e38a22b16c382/ios/RNReactNativeABeep.xcodeproj/project.xcworkspace/xcuserdata/trietho.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.xcodeproj/xcuserdata/trietho.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RNReactNativeABeep.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ios/RNReactNativeABeep.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | 3 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mock.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Mock implementation for test runners. 3 | * 4 | * Example: 5 | * 6 | * ```js 7 | * jest.mock('react-native-a-beep', () => require('react-native-a-beep/mock')); 8 | * ``` 9 | */ 10 | 11 | function NOOP() { 12 | // noop 13 | } 14 | 15 | const RNBeep = { 16 | beep: NOOP, 17 | PlaySysSound: NOOP, 18 | 19 | AndroidSoundIDs: { 20 | TONE_CDMA_ABBR_ALERT: NOOP, 21 | TONE_CDMA_ABBR_INTERCEPT: NOOP, 22 | TONE_CDMA_ABBR_REORDER: NOOP, 23 | TONE_CDMA_ALERT_AUTOREDIAL_LITE: NOOP, 24 | TONE_CDMA_ALERT_CALL_GUARD: NOOP, 25 | TONE_CDMA_ALERT_INCALL_LITE: NOOP, 26 | TONE_CDMA_ALERT_NETWORK_LITE: NOOP, 27 | TONE_CDMA_ANSWER: NOOP, 28 | TONE_CDMA_CALLDROP_LITE: NOOP, 29 | TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP: NOOP, 30 | TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL: NOOP, 31 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT3: NOOP, 32 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT5: NOOP, 33 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT6: NOOP, 34 | TONE_CDMA_CALL_SIGNAL_ISDN_PAT7: NOOP, 35 | TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING: NOOP, 36 | TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI: NOOP, 37 | TONE_CDMA_CONFIRM: NOOP, 38 | TONE_CDMA_DIAL_TONE_LITE: NOOP, 39 | TONE_CDMA_EMERGENCY_RINGBACK: NOOP, 40 | TONE_CDMA_HIGH_L: NOOP, 41 | TONE_CDMA_HIGH_PBX_L: NOOP, 42 | TONE_CDMA_HIGH_PBX_SLS: NOOP, 43 | TONE_CDMA_HIGH_PBX_SS: NOOP, 44 | TONE_CDMA_HIGH_PBX_SSL: NOOP, 45 | TONE_CDMA_HIGH_PBX_S_X4: NOOP, 46 | TONE_CDMA_HIGH_SLS: NOOP, 47 | TONE_CDMA_HIGH_SS: NOOP, 48 | TONE_CDMA_HIGH_SSL: NOOP, 49 | TONE_CDMA_HIGH_SS_2: NOOP, 50 | TONE_CDMA_HIGH_S_X4: NOOP, 51 | TONE_CDMA_INTERCEPT: NOOP, 52 | TONE_CDMA_KEYPAD_VOLUME_KEY_LITE: NOOP, 53 | TONE_CDMA_LOW_L: NOOP, 54 | TONE_CDMA_LOW_PBX_L: NOOP, 55 | TONE_CDMA_LOW_PBX_SLS: NOOP, 56 | TONE_CDMA_LOW_PBX_SS: NOOP, 57 | TONE_CDMA_LOW_PBX_SSL: NOOP, 58 | TONE_CDMA_LOW_PBX_S_X4: NOOP, 59 | TONE_CDMA_LOW_SLS: NOOP, 60 | TONE_CDMA_LOW_SS: NOOP, 61 | TONE_CDMA_LOW_SSL: NOOP, 62 | TONE_CDMA_LOW_SS_2: NOOP, 63 | TONE_CDMA_LOW_S_X4: NOOP, 64 | TONE_CDMA_MED_L: NOOP, 65 | TONE_CDMA_MED_PBX_L: NOOP, 66 | TONE_CDMA_MED_PBX_SLS: NOOP, 67 | TONE_CDMA_MED_PBX_SS: NOOP, 68 | TONE_CDMA_MED_PBX_SSL: NOOP, 69 | TONE_CDMA_MED_PBX_S_X4: NOOP, 70 | TONE_CDMA_MED_SLS: NOOP, 71 | TONE_CDMA_MED_SS: NOOP, 72 | TONE_CDMA_MED_SSL: NOOP, 73 | TONE_CDMA_MED_SS_2: NOOP, 74 | TONE_CDMA_MED_S_X4: NOOP, 75 | TONE_CDMA_NETWORK_BUSY: NOOP, 76 | TONE_CDMA_NETWORK_BUSY_ONE_SHOT: NOOP, 77 | TONE_CDMA_NETWORK_CALLWAITING: NOOP, 78 | TONE_CDMA_NETWORK_USA_RINGBACK: NOOP, 79 | TONE_CDMA_ONE_MIN_BEEP: NOOP, 80 | TONE_CDMA_PIP: NOOP, 81 | TONE_CDMA_PRESSHOLDKEY_LITE: NOOP, 82 | TONE_CDMA_REORDER: NOOP, 83 | TONE_CDMA_SIGNAL_OFF: NOOP, 84 | TONE_CDMA_SOFT_ERROR_LITE: NOOP, 85 | TONE_DTMF_0: NOOP, 86 | TONE_DTMF_1: NOOP, 87 | TONE_DTMF_2: NOOP, 88 | TONE_DTMF_3: NOOP, 89 | TONE_DTMF_4: NOOP, 90 | TONE_DTMF_5: NOOP, 91 | TONE_DTMF_6: NOOP, 92 | TONE_DTMF_7: NOOP, 93 | TONE_DTMF_8: NOOP, 94 | TONE_DTMF_9: NOOP, 95 | TONE_DTMF_A: NOOP, 96 | TONE_DTMF_B: NOOP, 97 | TONE_DTMF_C: NOOP, 98 | TONE_DTMF_D: NOOP, 99 | TONE_DTMF_P: NOOP, 100 | TONE_DTMF_S: NOOP, 101 | TONE_PROP_ACK: NOOP, 102 | TONE_PROP_BEEP: NOOP, 103 | TONE_PROP_BEEP2: NOOP, 104 | TONE_PROP_NACK: NOOP, 105 | TONE_PROP_PROMPT: NOOP, 106 | TONE_SUP_BUSY: NOOP, 107 | TONE_SUP_CALL_WAITING: NOOP, 108 | TONE_SUP_CONFIRM: NOOP, 109 | TONE_SUP_CONGESTION: NOOP, 110 | TONE_SUP_CONGESTION_ABBREV: NOOP, 111 | TONE_SUP_DIAL: NOOP, 112 | TONE_SUP_ERROR: NOOP, 113 | TONE_SUP_INTERCEPT: NOOP, 114 | TONE_SUP_INTERCEPT_ABBREV: NOOP, 115 | TONE_SUP_PIP: NOOP, 116 | TONE_SUP_RADIO_ACK: NOOP, 117 | TONE_SUP_RADIO_NOTAVAIL: NOOP, 118 | TONE_SUP_RINGTONE: NOOP, 119 | }, 120 | 121 | iOSSoundIDs: { 122 | MailReceived: NOOP, 123 | MailSent: NOOP, 124 | VoicemailReceived: NOOP, 125 | SMSReceived: NOOP, 126 | CalendarAlert: NOOP, 127 | LowPower: NOOP, 128 | SMSReceived_Alert1: NOOP, 129 | SMSReceived_Alert2: NOOP, 130 | SMSReceived_Alert3: NOOP, 131 | SMSReceived_Alert4: NOOP, 132 | SMSReceived_Vibrate: NOOP, 133 | SMSReceived_Alert5: NOOP, 134 | SMSReceived_Alert6: NOOP, 135 | SMSReceived_Alert7: NOOP, 136 | Voicemail: NOOP, 137 | SMSSent: NOOP, 138 | SMSReceived_Alert8: NOOP, 139 | SMSReceived_Alert9: NOOP, 140 | SMSReceived_Alert10: NOOP, 141 | SMSReceived_Alert11: NOOP, 142 | SMSReceived_Alert12: NOOP, 143 | SMSReceived_Alert13: NOOP, 144 | SMSReceived_Alert14: NOOP, 145 | SMSReceived_Alert15: NOOP, 146 | SMSReceived_Alert16: NOOP, 147 | SMSReceived_Alert17: NOOP, 148 | USSDAlert: NOOP, 149 | SIMToolkitTone1: NOOP, 150 | SIMToolkitTone2: NOOP, 151 | SIMToolkitTone3: NOOP, 152 | SIMToolkitTone4: NOOP, 153 | PINKeyPressed: NOOP, 154 | AudioToneBusy: NOOP, 155 | AudioToneCongestion: NOOP, 156 | AudioTonePathAcknowledge: NOOP, 157 | AudioToneError: NOOP, 158 | AudioToneCallWaiting: NOOP, 159 | AudioToneKey2: NOOP, 160 | ScreenLocked: NOOP, 161 | ScreenUnlocked: NOOP, 162 | FailedUnlock: NOOP, 163 | KeyPressed1: NOOP, 164 | KeyPressed2: NOOP, 165 | KeyPressed3: NOOP, 166 | ConnectedToPower: NOOP, 167 | RingerSwitchIndication: NOOP, 168 | CameraShutter: NOOP, 169 | ShakeToShuffle: NOOP, 170 | JBL_Begin: NOOP, 171 | JBL_Confirm: NOOP, 172 | JBL_Cancel: NOOP, 173 | BeginRecording: NOOP, 174 | EndRecording: NOOP, 175 | JBL_Ambiguous: NOOP, 176 | JBL_NoMatch: NOOP, 177 | BeginVideoRecording: NOOP, 178 | EndVideoRecording: NOOP, 179 | VCInvitationAccepted: NOOP, 180 | VCRinging: NOOP, 181 | VCEnded: NOOP, 182 | VCCallWaiting: NOOP, 183 | VCCallUpgrade: NOOP, 184 | TouchTone1: NOOP, 185 | TouchTone2: NOOP, 186 | TouchTone3: NOOP, 187 | TouchTone4: NOOP, 188 | TouchTone5: NOOP, 189 | TouchTone6: NOOP, 190 | TouchTone7: NOOP, 191 | TouchTone8: NOOP, 192 | TouchTone9: NOOP, 193 | TouchTone10: NOOP, 194 | TouchTone11: NOOP, 195 | TouchTone12: NOOP, 196 | Headset_StartCall: NOOP, 197 | Headset_Redial: NOOP, 198 | Headset_AnswerCall: NOOP, 199 | Headset_EndCall: NOOP, 200 | Headset_CallWaitingActions: NOOP, 201 | Headset_TransitionEnd: NOOP, 202 | SystemSoundPreview1: NOOP, 203 | SystemSoundPreview2: NOOP, 204 | SystemSoundPreview3: NOOP, 205 | SystemSoundPreview4: NOOP, 206 | SystemSoundPreview5: NOOP, 207 | SystemSoundPreview6: NOOP, 208 | KeyPressClickPreview: NOOP, 209 | SMSReceived_Selection1: NOOP, 210 | SMSReceived_Selection2: NOOP, 211 | SMSReceived_Selection3: NOOP, 212 | SMSReceived_Selection4: NOOP, 213 | SMSReceived_Selection5: NOOP, 214 | SMSReceived_Selection6: NOOP, 215 | SMSReceived_Selection7: NOOP, 216 | SystemSoundPreview: NOOP, 217 | SMSReceived_Selection8: NOOP, 218 | SMSReceived_Selection9: NOOP, 219 | SMSReceived_Selection10: NOOP, 220 | SMSReceived_Selection11: NOOP, 221 | SMSReceived_Selection12: NOOP, 222 | SMSReceived_Selection13: NOOP, 223 | SMSReceived_Selection14: NOOP, 224 | SMSReceived_Selection15: NOOP, 225 | SMSReceived_Selection16: NOOP, 226 | SMSReceived_Selection17: NOOP, 227 | SMSReceived_Selection18: NOOP, 228 | SMSReceived_Selection19: NOOP, 229 | SMSReceived_Selection20: NOOP, 230 | SMSReceived_Selection21: NOOP, 231 | SMSReceived_Selection22: NOOP, 232 | SMSReceived_Selection23: NOOP, 233 | SMSReceived_Selection24: NOOP, 234 | RingerVibeChanged: NOOP, 235 | SilentVibeChanged: NOOP, 236 | Vibrate: NOOP, 237 | }, 238 | }; 239 | 240 | module.exports = RNBeep; 241 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-a-beep", 3 | "version": "1.1.0", 4 | "description": "A very lite module to play system sounds and beep for react-native apps (no sound files)", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react-native", 11 | "system sounds" 12 | ], 13 | "author": "Triet Ho", 14 | "license": "FREE", 15 | "peerDependencies": { 16 | "react-native": "^0.69.3" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/trietho/react-native-a-beep.git" 21 | } 22 | } 23 | --------------------------------------------------------------------------------