Skip to content

Commit 087634f

Browse files
authored
Merge pull request #414 from Nightsd01/master
Fix setEmail and improve readme
2 parents c761ae3 + af12b80 commit 087634f

File tree

6 files changed

+459
-359
lines changed

6 files changed

+459
-359
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing to the OneSignal React-Native SDK
2+
3+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4+
5+
### How to Contribute
6+
We love the open source community and enjoy the support and contributions of many of our users. We ask that any potential contributors to the SDK Follow the following guidelines:
7+
8+
If your proposed contribution is a small bug fix, please feel free to create your own fork of the repository and create a pull request.
9+
10+
If your contribution would _break_ or _change_ the functionality of the SDK, please reach out to us on (contact) before you put in a lot of effort into a change we may not be able to use. We try our best to make sure that the SDK remains stable so that developers do not have to continually change their code, however some breaking changes _are_ desirable, so please get in touch to discuss your idea before you put in a lot of effort.
11+
12+
#### Reporting Bugs
13+
If you have found a bug with the SDK, please feel free to open an Issue.
14+
15+
If you are pretty certain that the issue is only related to the native iOS SDK, please open the issue in our [native iOS SDK repository](https://github.com/OneSignal/OneSignal-iOS-SDK).
16+
17+
If you are certain the issue is contained to the Android SDK, please open the issue in our [Android SDK repository](https://github.com/OneSignal/OneSignal-Android-SDK)
18+
19+
#### Before Submitting A Bug Report
20+
Before creating bug reports, please check this list of steps to follow.
21+
22+
1. Make sure that you are actually encountering an _issue_ and not a _question_. If you simply have a question about the SDK, we would be more than happy to assist you in our Support section on the web (https://www.onesignal.com - click the Message button at the bottom right)
23+
2. Please make sure to [include as many details as possible](#how-do-i-submit-a-good-bug-report)
24+
25+
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
26+
27+
28+
#### How Do I Submit a Good Bug Report
29+
* **Use a clear and descriptive title** for the issue to identify the problem.
30+
* **Include Reproducibility** It is nearly always a good idea to include steps to reproduct the issue. If you cannot reliably reproduce the issue yourself, that's ok, but reproducible steps help best.
31+
* **Describe your environment**, tell us what version of react-native your app is using, what version of the react-native-onesignal SDK you're using, how you added it to your project, and so on.
32+
* **Include a Stack Trace** If your issue involves a crash/exception, ***PLEASE*** post the stack trace to help us identify the root issue.
33+
* **Include an Example Project** This isn't required, but if you want your issue fixed quickly, it's often a good idea to include an example project as a zip and include it with the issue. You can also download the Demo project (included in the `/examples` folder of this repo) and set up an example project with this code as a starting point.

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ android {
159159

160160
### Adding the Code
161161

162+
<details><summary>Objective-C</summary><p>
163+
162164
* in `AppDelegate.h`:
163165
* Import `RCTOneSignal.h`:
164166

@@ -186,13 +188,49 @@ android {
186188
self.oneSignal = [[RCTOneSignal alloc] initWithLaunchOptions:launchOptions
187189
appId:@"YOUR_ONESIGNAL_APP_ID"];
188190
```
189-
191+
* You can also pass settings to OneSignal to control various effects, such as whether OneSignal automatically asks for permission to send push notifications shortly after launch or not.
190192
```objc
191-
// For requiring push notification permissions manually.
192193
self.oneSignal = [[RCTOneSignal alloc] initWithLaunchOptions:launchOptions
193194
appId:@"YOUR_ONESIGNAL_APP_ID"
194195
settings:@{kOSSettingsKeyAutoPrompt: @false}];
195196
```
197+
</p></details>
198+
199+
<details><summary>Swift</summary><p>
200+
201+
* If you don't already have one, create an Objective-C Bridging header for your project (`YourProjectName-Bridging-Header.h`) and import the React-Native-Onesignal library:
202+
203+
```objc
204+
#import <RCTOneSignal.h>
205+
```
206+
* In your AppDelegate, add the following property:
207+
208+
```swift
209+
var oneSignal : RCTOneSignal!
210+
```
211+
212+
* On the `application didFinishLaunchingWithOptions` method, insert the following code (replace YOUR_ONESIGNAL_APP_ID with your OneSignal app ID):
213+
214+
```swift
215+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
216+
217+
self.oneSignal = RCTOneSignal(launchOptions: launchOptions, appId: "YOUR_ONESIGNAL_APP_ID");
218+
}
219+
220+
```
221+
222+
* You can also pass settings to OneSignal to control various effects, such as whether OneSignal automatically asks for permission to send push notifications shortly after launch or not.
223+
224+
```swift
225+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
226+
227+
self.oneSignal = RCTOneSignal(launchOptions: launchOptions, appId: "YOUR_ONESIGNAL_APP_ID", settings: [kOSSettingsKeyAutoPrompt : false])
228+
}
229+
```
230+
231+
</p></details>
232+
233+
196234

197235
### Add Notification Service Extension
198236
This step is optional but highly recommended. The `OneSignalNotificationServiceExtension` allows your application (in iOS) to receive rich notifications with images and/or buttons. If you do not follow this step, your application will not be able to show images in push notifications, and won't be able to add action buttons to notifications either.

0 commit comments

Comments
 (0)