expo-invoke 3.1.3 → 3.1.5

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.
@@ -5,6 +5,7 @@ import android.content.ContentResolver
5
5
  import android.content.Context
6
6
  import android.content.Intent
7
7
  import android.net.Uri
8
+ import androidx.core.graphics.drawable.IconCompat
8
9
  import androidx.slice.Slice
9
10
  import androidx.slice.SliceProvider
10
11
  import androidx.slice.builders.ListBuilder
@@ -38,7 +39,11 @@ class InvokeSliceProvider : SliceProvider() {
38
39
  val subtitle = subtitleKey?.let { prefs.getString("widget.$it", null) }
39
40
 
40
41
  val tapIntent = buildTapIntent(context, intentId)
41
- val action = SliceAction.create(tapIntent, null, ListBuilder.ICON_IMAGE, title)
42
+ // SliceAction.create requires a non-null icon — build it from the consuming
43
+ // app's own launcher icon rather than hardcoding a resource name that would
44
+ // only exist in this SDK's own (nonexistent) resources.
45
+ val icon = IconCompat.createWithResource(context, context.applicationInfo.icon)
46
+ val action = SliceAction.create(tapIntent, icon, ListBuilder.ICON_IMAGE, title)
42
47
 
43
48
  return ListBuilder(context, sliceUri, ListBuilder.INFINITY)
44
49
  .addRow { row ->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-invoke",
3
- "version": "3.1.3",
3
+ "version": "3.1.5",
4
4
  "description": "The complete native-surface-to-JS bridge for Expo. One intent config → Siri, Google Assistant, home screen widgets, Dynamic Island, app icon menus, notification actions, NFC, QR, deep links and more — all through a single useInvoke() hook.",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/src/index.js",