Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
retyui committed Aug 1, 2023
1 parent 6ccb0ce commit 5cf7231
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ npm install react-native-widget-picker
Edit `android/app/src/main/java/com/.../MainActivity.java` and add:

```diff
+import com.retyui.widgetpicker.WidgetPickerModuleImpl;

public class MainActivity extends ReactActivity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ WidgetPickerModuleImpl.registerWidgetClass("MyAppWidget", MyAppWidget.class);
// you can register multiple widgets ^^^
// you can register multiple widgets ^^^
}
```

Expand All @@ -41,7 +43,7 @@ import {WidgetPicker} from 'react-native-widget-picker';

WidgetPicker.isRequestPinAppWidgetSupported() // true or false

WidgetPicker.requestPinAppWidget("MyAppWidget").then((value) => {
WidgetPicker.requestPinAppWidget("MyAppWidget").then((value) => { // "MyAppWidget" - name from MainActivity.java
if (value.message === "success") {
// success
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-widget-picker",
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",
"main": "dist/cjs",
"module": "dist/mjs",
Expand Down

0 comments on commit 5cf7231

Please sign in to comment.