File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,29 @@ public class MainActivity extends ReactActivity {
36
36
}
37
37
```
38
38
39
+ Kotlin ` MainActivity.kt ` example:
40
+
41
+ ``` diff
42
+ + import com.retyui.widgetpicker.WidgetPickerModuleImpl.Companion.registerWidgetClass
43
+
44
+ class MainActivity : ReactActivity() {
45
+ + override fun onCreate(savedInstanceState: Bundle?) {
46
+ + super.onCreate(savedInstanceState)
47
+ + registerWidgetClass("MyAppWidget", MyAppWidget::class.java)
48
+ + }
49
+ }
50
+ ```
51
+
39
52
## Usage
40
53
41
54
``` tsx
42
55
import {WidgetPicker } from ' react-native-widget-picker' ;
43
56
44
57
WidgetPicker .isRequestPinAppWidgetSupported () // true or false
45
58
46
- WidgetPicker .requestPinAppWidget (" MyAppWidget" ).then ((value ) => { // "MyAppWidget" - name from MainActivity.java
59
+ // "MyAppWidget" - name from MainActivity.java or .kt
60
+ WidgetPicker .requestPinAppWidget (" MyAppWidget" ).then ((value ) => {
61
+
47
62
if (value .message === " success" ) {
48
63
// success
49
64
}
You can’t perform that action at this time.
0 commit comments