スキップしてメイン コンテンツに移動

投稿

4月, 2019の投稿を表示しています

UnityのMobile Notification Packageの使い方

ランタイムAPIは、 AndroidNotificationCenter と iOSNotificationCenter の二つに分割されています(コードのサンプルのための適切なセクションを参照してください)。それぞれのプラットフォームの通知をスケジュールや管理することができます。 同じAPIを使用してAndroidとiOSの両方に通知を送信できるようにする、高レベルのラッパーを実装したサンプルプロジェクトが、 GitHubページにあります 。 サポートされている機能: 繰り返し可能なローカル通知または1回限りの通知をスケジュールします。 スケジュールされた通知またはすでに表示されている通知をキャンセル アンドロイド: Android Oreo以上で通知チャンネル(カテゴリ)を作成および変更します。 通知は、デバイスの再起動時に保存することができます カスタム通知アイコンを設定します。 iOS: Apple Push Notification Service(APN)を使ってリモート通知を受信します。 アプリの実行中に通知を受信した場合は、リモート通知の内容を変更します。 通知をスレッドにグループ化する(iOS 12以降でのみサポート) 必要条件 Android 4.1(API 16)/ iOS 10以上をサポートしています。 Unity 2018.3以降と互換性があります。   アンドロイド 通知チャンネルを作成する。 すべてのローカル通知は通知チャンネルに属します。通知チャンネルは、Oreo(8.0)以降のAndroidでのみサポートされています。 古いバージョンでパッケージを使用すると、チャンネルの振る舞いはエミュレートされます。 そのため、8.0より前の各通知に対して個別に設定された設定(priority( Importance )など)は、8.0より前のバージョンでもチャンネルに設定される必要があります。 var c = new AndroidNotificationChannel() { Id = "channel_id" , Name = "Default Channel" , Importance = Impor

【Unity】Unity Remote Settingsを使うとUnity 2018, 2019でエラーが起こる問題の解決方法

Unity Remote settingsを利用すると下記のエラーが表示されます: Assets/Editor/RemoteSettings/RemoteSettingsLinker.cs(23,18): error CS0535: `UnityEngine.Analytics.RemoteSettingsLinker' does not implement interface member `UnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.BuildTarget, string)' Assets/Editor/RemoteSettings/RemoteSettingsLinker.cs(23,18): error CS0535: `UnityEngine.Analytics.RemoteSettingsLinker' does not implement interface member `UnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.BuildTarget, string)' 解決方法 Assets/Editor/RemoteSettings/RemoteSettingsLinker.csの23行目の: public class RemoteSettingsLinker : IPreprocessBuild, IProcessScene を下記に置き換える public class RemoteSettingsLinker : IPreprocessBuildWithReport, IProcessSceneWithReport