rns-nativecall 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -96,30 +96,7 @@ object NativeCallManager {
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
// THIS IS THE CRITICAL PART:
|
|
101
|
-
// You must map the FCM data (Map<String, String>) into the Intent Extras
|
|
102
|
-
data.forEach { (key, value) ->
|
|
103
|
-
this.putExtra(key, value)
|
|
104
|
-
}
|
|
105
|
-
// Ensure we have a unique action so the system doesn't cache old data
|
|
106
|
-
action = "ACTION_ACCEPT_CALL_${System.currentTimeMillis()}"
|
|
107
|
-
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_USER_ACTION)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
val pendingFlags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
111
|
-
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE // MUST BE MUTABLE to carry data
|
|
112
|
-
} else {
|
|
113
|
-
PendingIntent.FLAG_UPDATE_CURRENT
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
val acceptPendingIntent = PendingIntent.getActivity(
|
|
117
|
-
context,
|
|
118
|
-
1001,
|
|
119
|
-
acceptIntent,
|
|
120
|
-
pendingFlags
|
|
121
|
-
)
|
|
122
|
-
|
|
99
|
+
|
|
123
100
|
notificationManager.notify(uuid.hashCode(), builder.build())
|
|
124
101
|
|
|
125
102
|
// Start Ringtone
|
package/package.json
CHANGED