@@ -65,9 +65,9 @@ class InCallManager {
65
65
_InCallManager . setMicrophoneMute ( enable ) ;
66
66
}
67
67
68
- startRingtone ( ringtone , vibrate , ios_category , seconds ) {
68
+ startRingtone ( ringtone , vibrate_pattern , ios_category , seconds ) {
69
69
ringtone = ( typeof ringtone === 'string' ) ? ringtone : "_DEFAULT_" ;
70
- vibrate = ( vibrate === true ) ? true : false ;
70
+ this . vibrate = ( Array . isArray ( vibrate_pattern ) ) ? true : false ;
71
71
ios_category = ( ios_category === 'playback' ) ? 'playback' : "default" ;
72
72
seconds = ( typeof seconds === 'number' && seconds > 0 ) ? parseInt ( seconds ) : - 1 ; // --- android only, default looping
73
73
@@ -77,13 +77,9 @@ class InCallManager {
77
77
_InCallManager . startRingtone ( ringtone , ios_category ) ;
78
78
}
79
79
80
- this . vibrate = vibrate ;
80
+ // --- should not use repeat, it may cause infinite loop in some cases.
81
81
if ( this . vibrate ) {
82
- if ( Platform . OS === 'android' ) {
83
- Vibration . vibrate ( [ 0 , 1000 , 3000 ] , true ) ;
84
- } else {
85
- Vibration . vibrate ( [ 0 , 3000 ] , true ) ; // --- should enable this after RN merged our PR
86
- }
82
+ Vibration . vibrate ( vibrate_pattern , false ) ; // --- ios needs RN 0.34 to support vibration pattern
87
83
}
88
84
}
89
85
0 commit comments