Skip to content

Commit

Permalink
Sets AndroidManifest.xml package values automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasten2 committed Jul 11, 2016
1 parent de0d4aa commit cade748
Show file tree
Hide file tree
Showing 183 changed files with 111 additions and 17 deletions.
Binary file removed Unity4.6-4.7OneSignalSDK.unitypackage
Binary file not shown.
1 change: 0 additions & 1 deletion Unity4.6OneSignalExample/Assets/Plugins/OneSignal/VERSION

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!-- NOTE: Replace all 3 copies ${manifestApplicationId} below with your full Android package name before building! -->
<!--
WARNING: Do NOT Modify! Changes will be overwritten by the OneSignal plugin.
Make your changes to Assets/Plugins/Android/AndroidManifest.xml instead.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.onesignal.onesignalsdk"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Android Setup
=====================

1. Open Plugins/Android/OneSignalConfig/AndroidManifest.xml and follow the insturctions.
2. Replace the example small notification icons in the res folder with your own with by follwing the insturctions below.
1. Replace the example small notification icons in the res folder with your own with by follwing the insturctions below.
- https://documentation.onesignal.com/docs/android-notification-customizations#small-notification-icon
3. The large notification icon is optional, remove or replace res/drawable-xxhdpi-v11/ic_onesignal_large_icon_default.png.
2. The large notification icon is optional, remove or replace res/drawable-xxhdpi-v11/ic_onesignal_large_icon_default.png.
5 changes: 5 additions & 0 deletions Unity4.7OneSignalExample/Assets/Plugins/OneSignal/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#if UNITY_ANDROID
using UnityEditor;
using System.IO;
using UnityEngine;

[InitializeOnLoad]
public class OneSignalEditorScript {

// Copies `AndroidManifestTemplate.xml` to `AndroidManifest.xml`
// then replace `${manifestApplicationId}` with current packagename in the Unity settings.
static OneSignalEditorScript () {
string oneSignalConfigPath = "Assets/Plugins/Android/OneSignalConfig/";
string manifestFullPath = oneSignalConfigPath + "AndroidManifest.xml";

File.Copy(oneSignalConfigPath + "AndroidManifestTemplate.xml", manifestFullPath, true);

StreamReader streamReader = new StreamReader(manifestFullPath);
string body = streamReader.ReadToEnd();
streamReader.Close();

body = body.Replace("${manifestApplicationId}", PlayerSettings.bundleIdentifier);
using (var streamWriter = new StreamWriter(manifestFullPath, false))
{
streamWriter.Write(body);
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Unity4.7OneSignalExample/Assets/Plugins/OneSignal/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.15.1
Binary file added Unity4.7OneSignalSDK.unitypackage
Binary file not shown.
9 changes: 9 additions & 0 deletions Unity5OneSignalExample/Assets/OneSignal/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#if UNITY_ANDROID
using UnityEditor;
using System.IO;
using UnityEngine;

[InitializeOnLoad]
public class OneSignalEditorScript {

// Copies `AndroidManifestTemplate.xml` to `AndroidManifest.xml`
// then replace `${manifestApplicationId}` with current packagename in the Unity settings.
static OneSignalEditorScript () {
string oneSignalConfigPath = "Assets/Plugins/Android/OneSignalConfig/";
string manifestFullPath = oneSignalConfigPath + "AndroidManifest.xml";

File.Copy(oneSignalConfigPath + "AndroidManifestTemplate.xml", manifestFullPath, true);

StreamReader streamReader = new StreamReader(manifestFullPath);
string body = streamReader.ReadToEnd();
streamReader.Close();

body = body.Replace("${manifestApplicationId}", PlayerSettings.bundleIdentifier);
using (var streamWriter = new StreamWriter(manifestFullPath, false))
{
streamWriter.Write(body);
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Unity5OneSignalExample/Assets/OneSignal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.15.0
1.15.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!-- NOTE: Replace all 3 copies ${manifestApplicationId} below with your full Android package name before building! -->
<!--
WARNING: Do NOT Modify! Changes will be overwritten by the OneSignal plugin.
Make your changes to Assets/Plugins/Android/AndroidManifest.xml instead.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.onesignal.onesignalsdk"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Android Setup
=====================

1. Open Plugins/Android/OneSignalConfig/AndroidManifest.xml and follow the insturctions.
2. Replace the example small notification icons in the res folder with your own with by follwing the insturctions below.
1. Replace the example small notification icons in the res folder with your own with by follwing the insturctions below.
- https://documentation.onesignal.com/docs/android-notification-customizations#small-notification-icon
3. The large notification icon is optional, remove or replace res/drawable-xxhdpi-v11/ic_onesignal_large_icon_default.png.
2. The large notification icon is optional, remove or replace res/drawable-xxhdpi-v11/ic_onesignal_large_icon_default.png.
2 changes: 1 addition & 1 deletion Unity5OneSignalExample/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 5.3.1f1
m_EditorVersion: 5.3.4f1
m_StandardAssetsVersion: 0
Binary file modified Unity5OneSignalSDK.unitypackage
Binary file not shown.

0 comments on commit cade748

Please sign in to comment.