Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
William Rijksen committed Aug 24, 2017
2 parents 90a5c25 + d51ccb4 commit 29eb931
Show file tree
Hide file tree
Showing 13 changed files with 706 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.classpath
.project
.settings
.idea
tmp
bin
build
Expand All @@ -12,3 +13,4 @@ build.properties
libs
*/dist/modules
*.xcuserdatad
node_modules
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Before setting up the Titanium SDK, you must generate the appropriate credential

```xml
<modules>
<module platform="iphone" version="1.7.0">com.williamrijksen.onesignal</module>
<module platform="android" version="1.7.0">com.williamrijksen.onesignal</module>
<module platform="iphone" version="1.7.1">com.williamrijksen.onesignal</module>
<module platform="android" version="1.7.1">com.williamrijksen.onesignal</module>
</modules>
```
1. Configure your app into the App Settings panel for the right Platform (Android and/or iOS).
Expand All @@ -30,8 +30,6 @@ Before setting up the Titanium SDK, you must generate the appropriate credential
1. To use OneSignal on Android devices, register some meta-data as well:

```xml
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data android:name="onesignal_app_id"
android:value="[App-id]" />
<meta-data android:name="onesignal_google_project_number"
Expand Down Expand Up @@ -148,3 +146,37 @@ Before setting up the Titanium SDK, you must generate the appropriate credential
```

Cheers!

## Build yourself

### iOS

If you already have Titanium installed, skip the first 2 steps, if not let's install Titanium locally.
1. `brew install yarn --without-node` to install yarn without relying on a specific Node version
1. In the ios directory execute `yarn install`
1. Alter the `titanium.xcconfig` to build with the preferred SDK
1. To build the module execute `rm -rf build && ./node_modules/.bin/ti build -p ios --build-only`
### Android
1. Copy `build.properties.dist` to `build.properties` and edit to match your environment
1. To build the module execute `rm -rf build && mkdir -p build/docs && ant`
#### Google Play Services
If for some reason you need to change the used Google Play Services version, execute the following actions:
1. Install the Google Play Services on your system:
```bash
sdkmanager "extras;google;m2repository"
```
1. Fetch the 4 needed *.aar files from the SDK path `extras/google/m2repository/com/google/android/gms`
- base
- gcm
- idd
- location
For the version you want use.
1. Extract the *.aar file, and rename the `classes.jar` to `google-play-services-<part>.jar`.
1. Update the used jars in the `lib` folder.
Binary file modified android/lib/google-play-services-base.jar
Binary file not shown.
Binary file added android/lib/google-play-services-gcm.jar
Binary file not shown.
Binary file added android/lib/google-play-services-idd.jar
Binary file not shown.
Binary file removed android/lib/google-play-services-location-gcm.jar
Binary file not shown.
Binary file added android/lib/google-play-services-location.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.7.0
version: 1.7.1
apiversion: 3
architectures: armeabi-v7a x86
description: com.williamrijksen.onesignal
Expand Down
2 changes: 1 addition & 1 deletion android/timodule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<!-- End: ShortcutBadger -->
<!-- ##END## OneSignal Permissions -->
<application>
<meta-data android:name="com.google.android.gms.version" android:value="7571000"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<!-- Application tag requirements below for OneSignal -->
<!-- ##START## OneSignal -->
<receiver android:name="com.onesignal.NotificationOpenedReceiver" />
Expand Down
5 changes: 2 additions & 3 deletions ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.7.0
version: 1.7.1
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: com.williamrijksen.onesignal
author: William Rijksen
license: Specify your license
copyright: Copyright (c) 2016 by Enrise
copyright: Copyright (c) 2017 by Enrise

# these should not be edited
name: com.williamrijksen.onesignal
moduleid: com.williamrijksen.onesignal
guid: 67065763-fd5e-4069-a877-6c7fd328f877
platform: iphone
minsdk: 6.0.0.GA
architectures: armv7 arm64 i386 x86_64
2 changes: 1 addition & 1 deletion ios/module.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
//
// IMPORTANT NOTE: always use $(inherited) in your overrides
//
FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/com.williamrijksen.onesignal/1.7.0/platform "~/Library/Application\ Support/Titanium/modules/iphone/com.williamrijksen.onesignal/1.7.0/platform"
FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/com.williamrijksen.onesignal/1.7.1/platform "~/Library/Application\ Support/Titanium/modules/iphone/com.williamrijksen.onesignal/1.7.1/platform"
OTHER_LDFLAGS=$(inherited) -framework OneSignal -framework UserNotifications
LD_RUNPATH_SEARCH_PATHS= $(inherited) "@executable_path/Frameworks" $(FRAMEWORK_SEARCH_PATHS)
5 changes: 5 additions & 0 deletions ios/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"titanium": "5.0.14"
}
}
Loading

0 comments on commit 29eb931

Please sign in to comment.