質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

解決済

1回答

2615閲覧

Xcodeエラー「UILocalNotification」は廃止

jo1jo2jo3

総合スコア45

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2020/08/23 16:35

編集2020/08/24 03:30

こんにちは
Unity でiosビルド後にXcodeを開くと非推奨の警告が出ます。
「UILocalNotification」は廃止されました:iOS 10.0で最初に廃止されました-UserNotificationsフレームワークのUNNotificationRequestを使用してください
と出ます。
コードをUNNotificationRequestに書き換えるとエラーが出る為、フレームワークを変更するような案内ですがフレームワークの意味がわかりません。
どのようにすれば良いのでしょうか 教えてください。
よろしくお願いします。

エラー表示
UnityFramework Group
Deprecations Group
/Users/nishiurashinji/Desktop/New Unity Project/IOSIQBALL/Classes/Unity/UnityInterface.h:154:36: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest

エラー翻訳
UnityFrameworkグループ
非推奨グループ
/ Users / nishiurashinji / Desktop / New Unity Project / IOSIQBALL / Classes / Unity / UnityInterface.h:154:36: 'UILocalNotification' is deprecated:first deprecated in iOS 10.0-Use UserNotifications Framework's UNNotificationRequest

....................................................................

イメージ説明

イメージ説明

❗️マークをクリックすると2件コード紹介されます。

❗️マーク
翻訳1
/ Users / nishiurashinji / Desktop / New Unity Project / IOSIQBALL / Classes / Prefix.pch:13:10:/ Users / nishiurashinji / Desktop / New Unity Project / IOSIQBALL / Classes / Prefix.pch:13からインクルードされたファイル:```//
紹介コード添付↓

// Prefix header // #include "Preprocessor.h" #ifdef __OBJC__ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #endif #include "UnityTrampolineConfigure.h" #include "UnityInterface.h" #ifndef __OBJC__ #if USE_IL2CPP_PCH #include "il2cpp_precompiled_header.h" #endif #endif #ifndef TARGET_IPHONE_SIMULATOR #define TARGET_IPHONE_SIMULATOR 0 #endif #define printf_console printf コード

❗️マーク2 翻訳
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalNotification.h:18:12: 'UILocalNotification' ここで非推奨と明示的にマークされています

紹介コード添付↓
コード

```#if (defined(USE_UIKIT_PUBLIC_HEADERS) && USE_UIKIT_PUBLIC_HEADERS) || !__has_include(<UIKitCore/UILocalNotification.h>) // // UILocalNotification.h // UIKit // // Copyright (c) 2007-2018 Apple Inc. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKitDefines.h> NS_ASSUME_NONNULL_BEGIN @class CLRegion; // In iOS 8.0 and later, your application must register for user notifications using -[UIApplication registerUserNotificationSettings:] before being able to schedule and present UILocalNotifications UIKIT_EXTERN API_DEPRECATED("Use UserNotifications Framework's UNNotificationRequest", ios(4.0, 10.0)) API_UNAVAILABLE(tvos) @interface UILocalNotification : NSObject<NSCopying, NSCoding> - (instancetype)init NS_DESIGNATED_INITIALIZER; - (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; // timer-based scheduling @property(nullable, nonatomic,copy) NSDate *fireDate; // the time zone to interpret fireDate in. pass nil if fireDate is an absolute GMT time (e.g. for an egg timer). // pass a time zone to interpret fireDate as a wall time to be adjusted automatically upon time zone changes (e.g. for an alarm clock). @property(nullable, nonatomic,copy) NSTimeZone *timeZone; @property(nonatomic) NSCalendarUnit repeatInterval; // 0 means don't repeat @property(nullable, nonatomic,copy) NSCalendar *repeatCalendar; // location-based scheduling // set a CLRegion object to trigger the notification when the user enters or leaves a geographic region, depending upon the properties set on the CLRegion object itself. registering multiple UILocalNotifications with different regions containing the same identifier will result in undefined behavior. the number of region-triggered UILocalNotifications that may be registered at any one time is internally limited. in order to use region-triggered notifications, applications must have "when-in-use" authorization through CoreLocation. see the CoreLocation documentation for more information. @property(nullable, nonatomic,copy) CLRegion *region API_AVAILABLE(ios(8.0)); // when YES, the notification will only fire one time. when NO, the notification will fire every time the region is entered or exited (depending upon the CLRegion object's configuration). default is YES. @property(nonatomic,assign) BOOL regionTriggersOnce API_AVAILABLE(ios(8.0)); // alerts @property(nullable, nonatomic,copy) NSString *alertBody; // defaults to nil. pass a string or localized string key to show an alert @property(nonatomic) BOOL hasAction; // defaults to YES. pass NO to hide launching button/slider @property(nullable, nonatomic,copy) NSString *alertAction; // used in UIAlert button or 'slide to unlock...' slider in place of unlock @property(nullable, nonatomic,copy) NSString *alertLaunchImage; // used as the launch image (UILaunchImageFile) when launch button is tapped @property(nullable, nonatomic,copy) NSString *alertTitle API_AVAILABLE(ios(8.2)); // defaults to nil. pass a string or localized string key // sound @property(nullable, nonatomic,copy) NSString *soundName; // name of resource in app's bundle to play or UILocalNotificationDefaultSoundName // badge @property(nonatomic) NSInteger applicationIconBadgeNumber; // 0 means no change. defaults to 0 // user info @property(nullable, nonatomic,copy) NSDictionary *userInfo; // throws if contains non-property list types // category identifer of the local notification, as set on a UIUserNotificationCategory and passed to +[UIUserNotificationSettings settingsForTypes:categories:] @property (nullable, nonatomic, copy) NSString *category API_AVAILABLE(ios(8.0)); @end UIKIT_EXTERN NSString *const UILocalNotificationDefaultSoundName API_DEPRECATED("Use UserNotifications Framework's +[UNNotificationSound defaultSound]", ios(4.0, 10.0)) API_UNAVAILABLE(tvos); NS_ASSUME_NONNULL_END #else #import <UIKitCore/UILocalNotification.h> #endif コード

追加 
Unity2019.4.8f1使用してます。
それらしきヒント見つけましたがunity側で直すのかビルド後のxcodeで直すのかわかりませんので教えてください。
こちら↓
https://qiita.com/mshrwtnb/items/3135e931eedc97479bb5

イタリックテキスト

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Unityには詳しくないですが、Unity 2020.1.0のリリースノートに以下の言及がありました。

  • iOS: Obsoleted: iOS.Notification Services is now deprecated and will be removed in the future. Consider using the Mobile Notifications package (available in the package manager) which implements the UserNotifications framework.

Source: https://unity3d.com/jp/unity/whats-new/2020.1.0

Unityのバージョンを上げたうえで、パッケージマネージャーとやらから利用できるMobile Notification packageとやらを利用するように検討されてはいかがでしょうか。

フレームワークを変更するような案内ですがフレームワークの意味がわかりません。

これはSwiftコード上 (Objective-Cコード上) の話で、import UserNotification することで利用できるようになる UNNotificationRequest クラスを利用するように変更してくださいという内容です。
XcodeはあくまでSwift/Objective-Cしか理解しません (厳密にはそんなことないですが、おおよそ。) ので、Swift/Objective-Cでの修正方法を提案してきます。

投稿2020/08/24 04:35

thyda.eiqau

総合スコア2982

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jo1jo2jo3

2020/08/24 04:47

回答ありがとうございます。 やってみます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問