Skip to content

Commit

Permalink
[docs] add links to React Native samples for some tested packages (Az…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymeng authored Apr 6, 2023
1 parent 75761c1 commit d9e540b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion samples/frameworks/react-native/appconfigBasic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Open App.tsx and add the following code so it looks similar to following code

### Add the App Configuration sample file

create a new file `appConfigSample.ts` in the sample directory as `App.tsx` with following content from [appConfigSample.ts](https://github.com/Azure/azure-sdk-for-js/samples/frameworks/react-native/appconfigBasic/appConfigSample.ts) file
create a new file `appConfigSample.ts` in the sample directory as `App.tsx` with following content from [appConfigSample.ts](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/frameworks/react-native/appconfigBasic/appConfigSample.ts) file

### Add dependencies

Expand Down
4 changes: 4 additions & 0 deletions sdk/appconfiguration/app-configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ setLogLevel("info");

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).

### React Native support

React Native does not support some JavaScript API used by this SDK library so you need to provide polyfills for them. Please see our [React Native sample with Expo](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/frameworks/react-native/appconfigBasic/README.md#add-polyfills) for more details.

## Next steps

The following samples show you the various ways you can interact with App Configuration:
Expand Down
4 changes: 4 additions & 0 deletions sdk/eventhub/event-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ export default {

Please consult the documentation of your favorite bundler for more information on using polyfills.

### React Native Support

Similar to browsers, React Native does not support some JavaScript API used by this SDK library so you need to provide polyfills for them. Please see the [Messaging React Native sample with Expo](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/frameworks/react-native-expo/ts/messaging/README.md) for more details.

### Authenticate the client

Interaction with Event Hubs starts with either an instance of the
Expand Down
24 changes: 13 additions & 11 deletions sdk/notificationhubs/notification-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Once created, the Notification Hub can be configured using the [Azure Portal or
This SDK for JavaScript offers two ways of interacting with Azure Notification Hubs, either through the class-based approach, or with a modular design approach. The class-based approach is consistent across all packages to create a client and then interact with the methods on the client.

```typescript
import {
import {
NotificationHubsClient,
createAppleInstallation
createAppleInstallation
} from "@azure/notification-hubs";

const client = new NotificationHubsClient("<connection string>", "<hub name>");
Expand All @@ -68,9 +68,9 @@ const installation = createAppleInstallation({
const result = await client.createOrUpdateInstallation(installation);
```

The modular approach allows the developer to pick and choose which functions to import as each method is exposed individually. This approach uses subpath-exports with ES-Modules to expose the methods via direct imports. With the individual exports, this creates a better tree-shaking experience and smaller bundle sizes that the developer can take advantage of.
The modular approach allows the developer to pick and choose which functions to import as each method is exposed individually. This approach uses subpath-exports with ES-Modules to expose the methods via direct imports. With the individual exports, this creates a better tree-shaking experience and smaller bundle sizes that the developer can take advantage of.

Note that creating a client is exposed through the `"@azure/notification-hubs/api"` subpath and all client methods are exposed through the `"@azure/notification-hubs/api"` subpath. Each function exported takes the `client` as the first parameter and the rest of the parameters remain unchanged.
Note that creating a client is exposed through the `"@azure/notification-hubs/api"` subpath and all client methods are exposed through the `"@azure/notification-hubs/api"` subpath. Each function exported takes the `client` as the first parameter and the rest of the parameters remain unchanged.

The following subpaths are exposed:

Expand Down Expand Up @@ -293,10 +293,10 @@ registration = await client.updateRegistration(registration);
Using the modular approach, the code would be as follows:

```typescript
import {
createClientContext,
getRegistration,
updateRegistration
import {
createClientContext,
getRegistration,
updateRegistration
} from "@azure/notification-hubs/api";

const context = createClientContext("<connection string>", "<hub name>");
Expand Down Expand Up @@ -384,7 +384,7 @@ const result = await sendNotification(context, notification);
Notification Hubs can be used to send notifications to all registered devices per platform using broadcast send through the `sendNotification` method.

```typescript
import {
import {
NotificationHubsClient,
createAppleNotification,
} from "@azure/notification-hubs/api";
Expand Down Expand Up @@ -443,7 +443,7 @@ if (result.notificationId) {

#### Direct Send

To send directly a device, the user can send using the platform provided unique identifier such as APNs device token by calling the `sendNotification` method with a `deviceHandle` parameter.
To send directly a device, the user can send using the platform provided unique identifier such as APNs device token by calling the `sendNotification` method with a `deviceHandle` parameter.

```typescript
import {
Expand Down Expand Up @@ -663,9 +663,11 @@ React Native currently does not have support for [`URLSearchParams`] which is us
import 'url-search-params-polyfill';
```

We also need to provide polyfill for `TextEncoder` API and async iterator API. Please see our [React Native sample with Expo](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/frameworks/react-native/appconfigBasic/README.md#add-polyfills) for more details.

### Diagnose Dropped Notifications

Azure Notification Hubs has a complete guide to troubleshooting problems with dropped notifications in the [Diagnose dropped notifications in Azure Notification Hubs Guide](https://docs.microsoft.com/azure/notification-hubs/notification-hubs-push-notification-fixer).
Azure Notification Hubs has a complete guide to troubleshooting problems with dropped notifications in the [Diagnose dropped notifications in Azure Notification Hubs Guide](https://docs.microsoft.com/azure/notification-hubs/notification-hubs-push-notification-fixer).

[Test send](https://docs.microsoft.com/azure/notification-hubs/notification-hubs-push-notification-fixer#enabletestsend-property) is supported supported in the `sendNotification` method with the `enableTestSend` option:

Expand Down
4 changes: 4 additions & 0 deletions sdk/servicebus/service-bus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ export default {

Please consult the documentation of your favorite bundler for more information on using polyfills.

### React Native Support

Similar to browsers, React Native does not support some JavaScript api used by this SDK library so you need to provide polyfills for them. Please see the [Messaging React Native sample with Expo](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/frameworks/react-native-expo/ts/messaging/README.md) for more details.

### Authenticate the client

Interaction with Service Bus starts with an instance of the [ServiceBusClient][sbclient] class. You can
Expand Down

0 comments on commit d9e540b

Please sign in to comment.