CPManager Class Reference
Inherits from | NSObject |
Conforms to | CPManagerDelegate CPRegisterTokenRequestDelegate CPUnregisterTokenRequestDelegate |
Declared in | CPManager.h CPManager.m |
Tasks
Other Methods
-
+ shared
シングルトンインスタンスの生成
-
– setConfigKey:
CORE PUSHのコンフィグキーを設定する
-
– setPushEnabled:
CORE PUSHの通知設定の有無を設定する
-
– setDebugEnabled:
CORE PUSHのデバッグログを出力する
-
– registerForRemoteNotifications
APNSの通知サービスにデバイスを登録する。 デフォルトでは通知のアラート、バッジ、サウンドをONに設定
-
– registerForRemoteNotificationTypes:
APNSの通知サービスにデバイスを登録する。
-
– registerDeviceToken:
CORE PUSHにデバイストークンを登録する。
変換したデバイストークンの文字列は UserDefaultsに CPDeviceTokenKeyキー で保存されます。
デバイストークンの登録が成功した場合は CPManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に 通知を行います。
デバイストークンの登録が失敗した場合は CPManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。 -
– unregisterDeviceToken
CORE PUSHからデバイストークンを削除する
デバイストークン削除時に UserDefaults の CPDeviceTokenキー に保存されたデバイストークンを空文字で保存します。
デバイストークンの削除が成功した場合は CPManagerUnregisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に通知を行います。
デバイストークンの削除が失敗した場合は CPManagerUnregisterTokenRequestFailNotification の通知キーで NSNotificationCenter に通知を行います。 -
– handleRemoteNotification:
アプリがフォアグランド・バックグランド状態で動作中に通知を受信した時の動作を定義する。
バックラウンド状態で通知を受信後に通知からアプリを起動した場合、 CPManagerDelegate#handleBackgroundNotificationが呼び出されます。
フォアグランド状態で通知を受信した場合、CPManagerDelegate#handleForegroundNotificationが呼び出されます。 -
– handleLaunchingNotificationWithOption:
アプリのプロセスが起動していない状態で通知からアプリを起動した時の処理を定義する。
launchOptionsに通知のUserInfoが存在する場合は、CPManagerDelegate#handleLaunchingNotificationを 呼び出し、存在しない場合は何も行わない。 -
– handleBackgroundNotification:
アプリがバックグランドで動作中に通知からアプリを起動した時に CPManager#handleRemoteNotification から呼び出されます。
-
– handleForegroundNotifcation:
アプリがフォアグランドで動作中に通知を受信した時に CPManager#handleRemoteNotification から呼び出されます。
-
– handleLaunchingNotification:
アプリのプロセスが起動していない状態で通知からアプリを起動した時に CPManager#handleLaunchingNotificationWithOption から呼び出されます。
-
+ resetApplicationIconBadgeNumber
アプリケーションアイコンのバッジ数をリセットする
-
+ setApplicationIconBadgeNumber:
アプリケーションアイコンのバッジ数を設定する。
-
– registerTokenRequestSuccess
CORE PUSHからデバイストークンの登録が成功した時に呼ばれる
-
– registerTokenRequestFail
CORE PUSHからデバイストークンの登録が失敗した時に呼ばれる
-
– unregisterTokenRequestSuccess
CORE PUSHからデバイストークンの削除が成功した時に呼ばれる
-
– unregisterTokenRequestFail
CORE PUSHからデバイストークンの削除が失敗した時に呼ばれる
Other Methods
-
configKey
CORE PUSHのコンフィグキーを設定する
property -
pushEnabled
CORE PUSHの通知設定の有無を設定する
property -
debugEnabled
CORE PUSHのデバッグログを出力する
property -
delegate
CPManagerDelegateプロトコルを実装したクラス
property
Properties
configKey
CORE PUSHのコンフィグキーを設定する
@property (nonatomic, retain) NSString *configKey
Parameters
- configKey
CORE PUSHのコンフィグキーの値。
指定したコンフィグキーは UserDefaultsに CPConfigKey のキーで保存されます。
Declared In
CPManager.h
debugEnabled
CORE PUSHのデバッグログを出力する
@property (nonatomic, assign) BOOL debugEnabled
Parameters
- debugEnable
デバッグログを出力する場合は YES、出力しない場合は NOを設定する
Declared In
CPManager.h
Class Methods
resetApplicationIconBadgeNumber
アプリケーションアイコンのバッジ数をリセットする
+ (void)resetApplicationIconBadgeNumber
Declared In
CPManager.h
Instance Methods
handleBackgroundNotification:
アプリがバックグランドで動作中に通知からアプリを起動した時に CPManager#handleRemoteNotification から呼び出されます。
- (void)handleBackgroundNotification:(NSDictionary *)userInfo
Parameters
- userInfo
通知情報を含むオブジェクト
Declared In
CPManager.h
handleForegroundNotifcation:
アプリがフォアグランドで動作中に通知を受信した時に CPManager#handleRemoteNotification から呼び出されます。
- (void)handleForegroundNotifcation:(NSDictionary *)userInfo
Parameters
- userInfo
通知情報を含むオブジェクト
Declared In
CPManager.h
handleLaunchingNotification:
アプリのプロセスが起動していない状態で通知からアプリを起動した時に CPManager#handleLaunchingNotificationWithOption から呼び出されます。
- (void)handleLaunchingNotification:(NSDictionary *)userInfo
Parameters
- userInfo
通知情報を含むオブジェクト
Declared In
CPManager.h
handleLaunchingNotificationWithOption:
アプリのプロセスが起動していない状態で通知からアプリを起動した時の処理を定義する。
launchOptionsに通知のUserInfoが存在する場合は、CPManagerDelegate#handleLaunchingNotificationを
呼び出し、存在しない場合は何も行わない。
- (void)handleLaunchingNotificationWithOption:(NSDictionary *)launchOptions
Parameters
- launchOptions
起動オプション。UIApplicationLaunchOptionsRemoteNotificationKeyをキーにUserInfoオブジェクトを取得する
Declared In
CPManager.h
handleRemoteNotification:
アプリがフォアグランド・バックグランド状態で動作中に通知を受信した時の動作を定義する。
バックラウンド状態で通知を受信後に通知からアプリを起動した場合、
CPManagerDelegate#handleBackgroundNotificationが呼び出されます。
フォアグランド状態で通知を受信した場合、CPManagerDelegate#handleForegroundNotificationが呼び出されます。
- (void)handleRemoteNotification:(NSDictionary *)userInfo
Parameters
- userInfo
通知の情報を含むオブジェクト
Declared In
CPManager.h
registerDeviceToken:
CORE PUSHにデバイストークンを登録する。
変換したデバイストークンの文字列は UserDefaultsに CPDeviceTokenKeyキー で保存されます。
デバイストークンの登録が成功した場合は CPManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に
通知を行います。
デバイストークンの登録が失敗した場合は CPManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。
- (void)registerDeviceToken:(NSData *)token
Parameters
- token
APNSサーバから取得したデバイストークンのバイト列。
Declared In
CPManager.h
registerForRemoteNotificationTypes:
APNSの通知サービスにデバイスを登録する。
- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types
Parameters
- types
通知タイプ
Declared In
CPManager.h
registerForRemoteNotifications
APNSの通知サービスにデバイスを登録する。 デフォルトでは通知のアラート、バッジ、サウンドをONに設定
- (void)registerForRemoteNotifications
Declared In
CPManager.h
registerTokenRequestFail
CORE PUSHからデバイストークンの登録が失敗した時に呼ばれる
- (void)registerTokenRequestFail
Declared In
CPRegisterTokenRequest.h
registerTokenRequestSuccess
CORE PUSHからデバイストークンの登録が成功した時に呼ばれる
- (void)registerTokenRequestSuccess
Declared In
CPRegisterTokenRequest.h
setConfigKey:
CORE PUSHのコンフィグキーを設定する
- (void)setConfigKey:(NSString *)configKey
Parameters
- configKey
CORE PUSHのコンフィグキーの値。
指定したコンフィグキーは UserDefaultsに CPConfigKey のキーで保存されます。
Declared In
CPManager.h
setDebugEnabled:
CORE PUSHのデバッグログを出力する
- (void)setDebugEnabled:(BOOL)debugEnabled
Parameters
- debugEnable
デバッグログを出力する場合は YES、出力しない場合は NOを設定する
Declared In
CPManager.h
setPushEnabled:
CORE PUSHの通知設定の有無を設定する
- (void)setPushEnabled:(BOOL)pushEnabled
Parameters
- pushEnabled
CORE PUSHの通知設定が有効な場合は YES、無効な場合は NO を設定する。
指定した値は UserDefaultsに CPPushEnabledKey のキーで保存されます。
Declared In
CPManager.h
unregisterDeviceToken
CORE PUSHからデバイストークンを削除する
デバイストークン削除時に UserDefaults の CPDeviceTokenキー に保存されたデバイストークンを空文字で保存します。
デバイストークンの削除が成功した場合は CPManagerUnregisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に通知を行います。
デバイストークンの削除が失敗した場合は CPManagerUnregisterTokenRequestFailNotification の通知キーで NSNotificationCenter に通知を行います。
- (void)unregisterDeviceToken
Declared In
CPManager.h