Skip to content

KiiCorp/KiiUnityPushPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KiiUnityPushPlugin

This project is native plugin to receive push notification for the Unity3D.
You can customize the behavior when app receives a push notification.

Overview about the push notification mechanism

  +--------------------------+
  |                          |
  |  Google Cloud Messaging  |
  |                          |
  +--------------------------+
              |
              | 1. Push Notification from Google server
              |
+-------------+-----------------+---------------------------------------------------------------+
|             |                 |                                                               |
|             V                 |                                                               |
| +--------------------------+  |                        +------------------+                   |
| |                          |  | 2. UnitySendMessage()  |                  |                   |
| |  androidpushplugin.jar   |--+----------+-----------> | KiiPushPlugin.cs |                   |
| |                          |  |          |             |                  |                   |
| +--------------------------+  |          |             +------------------+                   |
|                               |          |                      |                             |
|                               |          |                      |                             |
|                               |          |                      | 3. OnPushMessageReceived()  |
|                               |          |                      |                             |
|                               |          |                      V                             |
| +--------------------------+  |          |             +------------------+                   |             
| |                          |  |          |             |                  |                   |
| | UIApplication+KiiCloud.m |--+----------+             | YourUnityCode.cs |                   |
| |                          |  |                        |                  |                   |
| +--------------------------+  |                        +------------------+                   |
|            4                  |                                                               |
|            |                  |                                                               |
+-----[Native|Plugin Layer]-----+-----------------------[Unity Layer]---------------------------+
             |
             | 1. Push Notification from Apple server
             |
  +------------------------+
  |                        |
  |          APNS          |
  |                        |
  +------------------------+

Support for iOS 8

  1. Plugin supports for iOS8 remote push registration as well as earlier iOS version on XCode 6 development environment.
  2. If your iOS development environment still using XCode 5.xx, you should remove iOS8 specific push API on UnityPushPlugin/Assets/Plugins/iOS/DefaultPush.m to avoid compile error.
  3. For further explanations, please refer to documentation.

Customize the behavior of iOS

  1. implement a custom code by editing UnityPushPlugin/Assets/Plugins/iOS/UIApplication+KiiCloud.m
  2. add DllImport statement to UnityPushPlugin/Assets/Plugins/KiiPushPlugin.cs if you want to use the native method which you've implemented.

Customize the behavior of Android

  1. import AndroidPushPlugin/ project into the Eclipse.
  2. implement a custom code.
  3. add code to call native code using AndroidJavaObject class to UnityPushPlugin/Assets/Plugins/KiiPushPlugin.cs.

Build

Requirements

  1. AndroidSDK
  2. Apache Ant
  3. Unity Pro

How to build

  1. $ sh build.sh
  2. KiiPushPlugin.unitypackage will be generated in bin directory.

Support

If you have any questions, please feel free to ask at community.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published