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のデバッグログを出力する
-
– registerForRemoteNotificationsAPNSの通知サービスにデバイスを登録する。 デフォルトでは通知のアラート、バッジ、サウンドをONに設定
-
– registerForRemoteNotificationTypes:APNSの通知サービスにデバイスを登録する。
-
– registerDeviceToken:CORE PUSHにデバイストークンを登録する。
変換したデバイストークンの文字列は UserDefaultsに CPDeviceTokenKeyキー で保存されます。
デバイストークンの登録が成功した場合は CPManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に 通知を行います。
デバイストークンの登録が失敗した場合は CPManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。 -
– unregisterDeviceTokenCORE 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:アプリケーションアイコンのバッジ数を設定する。
-
– registerTokenRequestSuccessCORE PUSHからデバイストークンの登録が成功した時に呼ばれる
-
– registerTokenRequestFailCORE PUSHからデバイストークンの登録が失敗した時に呼ばれる
-
– unregisterTokenRequestSuccessCORE PUSHからデバイストークンの削除が成功した時に呼ばれる
-
– unregisterTokenRequestFailCORE PUSHからデバイストークンの削除が失敗した時に呼ばれる
Other Methods
-
configKeyCORE PUSHのコンフィグキーを設定する
property -
pushEnabledCORE PUSHの通知設定の有無を設定する
property -
debugEnabledCORE PUSHのデバッグログを出力する
property -
delegateCPManagerDelegateプロトコルを実装したクラス
property
Properties
configKey
CORE PUSHのコンフィグキーを設定する
@property (nonatomic, retain) NSString *configKeyParameters
- configKey
CORE PUSHのコンフィグキーの値。
指定したコンフィグキーは UserDefaultsに CPConfigKey のキーで保存されます。
Declared In
CPManager.hdebugEnabled
CORE PUSHのデバッグログを出力する
@property (nonatomic, assign) BOOL debugEnabledParameters
- debugEnable
デバッグログを出力する場合は YES、出力しない場合は NOを設定する
Declared In
CPManager.hClass Methods
resetApplicationIconBadgeNumber
アプリケーションアイコンのバッジ数をリセットする
+ (void)resetApplicationIconBadgeNumberDeclared In
CPManager.hInstance Methods
handleBackgroundNotification:
アプリがバックグランドで動作中に通知からアプリを起動した時に CPManager#handleRemoteNotification から呼び出されます。
- (void)handleBackgroundNotification:(NSDictionary *)userInfoParameters
- userInfo
通知情報を含むオブジェクト
Declared In
CPManager.hhandleForegroundNotifcation:
アプリがフォアグランドで動作中に通知を受信した時に CPManager#handleRemoteNotification から呼び出されます。
- (void)handleForegroundNotifcation:(NSDictionary *)userInfoParameters
- userInfo
通知情報を含むオブジェクト
Declared In
CPManager.hhandleLaunchingNotification:
アプリのプロセスが起動していない状態で通知からアプリを起動した時に CPManager#handleLaunchingNotificationWithOption から呼び出されます。
- (void)handleLaunchingNotification:(NSDictionary *)userInfoParameters
- userInfo
通知情報を含むオブジェクト
Declared In
CPManager.hhandleLaunchingNotificationWithOption:
アプリのプロセスが起動していない状態で通知からアプリを起動した時の処理を定義する。
launchOptionsに通知のUserInfoが存在する場合は、CPManagerDelegate#handleLaunchingNotificationを
呼び出し、存在しない場合は何も行わない。
- (void)handleLaunchingNotificationWithOption:(NSDictionary *)launchOptionsParameters
- launchOptions
起動オプション。UIApplicationLaunchOptionsRemoteNotificationKeyをキーにUserInfoオブジェクトを取得する
Declared In
CPManager.hhandleRemoteNotification:
アプリがフォアグランド・バックグランド状態で動作中に通知を受信した時の動作を定義する。
バックラウンド状態で通知を受信後に通知からアプリを起動した場合、
CPManagerDelegate#handleBackgroundNotificationが呼び出されます。
フォアグランド状態で通知を受信した場合、CPManagerDelegate#handleForegroundNotificationが呼び出されます。
- (void)handleRemoteNotification:(NSDictionary *)userInfoParameters
- userInfo
通知の情報を含むオブジェクト
Declared In
CPManager.hregisterDeviceToken:
CORE PUSHにデバイストークンを登録する。
変換したデバイストークンの文字列は UserDefaultsに CPDeviceTokenKeyキー で保存されます。
デバイストークンの登録が成功した場合は CPManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に
通知を行います。
デバイストークンの登録が失敗した場合は CPManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。
- (void)registerDeviceToken:(NSData *)tokenParameters
- token
APNSサーバから取得したデバイストークンのバイト列。
Declared In
CPManager.hregisterForRemoteNotificationTypes:
APNSの通知サービスにデバイスを登録する。
- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)typesParameters
- types
通知タイプ
Declared In
CPManager.hregisterForRemoteNotifications
APNSの通知サービスにデバイスを登録する。 デフォルトでは通知のアラート、バッジ、サウンドをONに設定
- (void)registerForRemoteNotificationsDeclared In
CPManager.hregisterTokenRequestFail
CORE PUSHからデバイストークンの登録が失敗した時に呼ばれる
- (void)registerTokenRequestFailDeclared In
CPRegisterTokenRequest.hregisterTokenRequestSuccess
CORE PUSHからデバイストークンの登録が成功した時に呼ばれる
- (void)registerTokenRequestSuccessDeclared In
CPRegisterTokenRequest.hsetConfigKey:
CORE PUSHのコンフィグキーを設定する
- (void)setConfigKey:(NSString *)configKeyParameters
- configKey
CORE PUSHのコンフィグキーの値。
指定したコンフィグキーは UserDefaultsに CPConfigKey のキーで保存されます。
Declared In
CPManager.hsetDebugEnabled:
CORE PUSHのデバッグログを出力する
- (void)setDebugEnabled:(BOOL)debugEnabledParameters
- debugEnable
デバッグログを出力する場合は YES、出力しない場合は NOを設定する
Declared In
CPManager.hsetPushEnabled:
CORE PUSHの通知設定の有無を設定する
- (void)setPushEnabled:(BOOL)pushEnabledParameters
- pushEnabled
CORE PUSHの通知設定が有効な場合は YES、無効な場合は NO を設定する。
指定した値は UserDefaultsに CPPushEnabledKey のキーで保存されます。
Declared In
CPManager.hunregisterDeviceToken
CORE PUSHからデバイストークンを削除する
デバイストークン削除時に UserDefaults の CPDeviceTokenキー に保存されたデバイストークンを空文字で保存します。
デバイストークンの削除が成功した場合は CPManagerUnregisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に通知を行います。
デバイストークンの削除が失敗した場合は CPManagerUnregisterTokenRequestFailNotification の通知キーで NSNotificationCenter に通知を行います。
- (void)unregisterDeviceTokenDeclared In
CPManager.h