Inherits from NSObject
Conforms to CLLocationManagerDelegate
CorePushManagerDelegate
CorePushRegisterTokenRequestDelegate
CorePushRegisterUserAttributesRequestDelegate
CorePushUnregisterTokenRequestDelegate
Declared in CorePushManager.h
CorePushManager.m

Overview

CORE PUSHのマネジャークラス

Tasks

Other Methods

  • + shared

    シングルトンインスタンスの生成

  • – setConfigKey:

    CORE PUSHのコンフィグキーを設定する

  • – setPushEnabled:

    CORE PUSHの通知設定の有無を設定する

  • – setDebugEnabled:

    CORE PUSHのデバッグログを出力する

  • – setDeviceIdEnabled:

    デバイスIDをCORE PUSHサーバに送信するかを設定する。

  • – setDeviceIdHashEnabled:

    デバイスIDをMD5ハッシュ化の有無を設定する。

  • – setCategoryIds:

    CORE PUSHのカテゴリIDを設定する。

  • – setMultiCategoryIds:

    CORE PUSHのカテゴリIDを設定する。

  • – setAppUserId:

    CORE PUSHのユーザーIDを設定する。 @param アプリのユーザーID。

  • – registerForRemoteNotifications

    APNSの通知サービスにデバイスを登録する。 デフォルトでは通知のアラート、バッジ、サウンドをONに設定

  • – registerForRemoteNotificationTypes:

    APNSの通知サービスにデバイスを登録する。

  • – registerDeviceToken:

    CORE PUSHにデバイストークンを登録する。
    変換したデバイストークンの文字列は UserDefaultsに CorePushDeviceTokenKeyキー で保存されます。
    デバイストークンの登録が成功した場合は CorePushManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に 通知を行います。
    デバイストークンの登録が失敗した場合は CorePushManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。

  • – registerDeviceTokenString:

    CORE PUSHにデバイストークンを登録する。
    変換したデバイストークンの文字列は UserDefaultsに CorePushDeviceTokenKeyキー で保存されます。
    デバイストークンの登録が成功した場合は CorePushManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に 通知を行います。
    デバイストークンの登録が失敗した場合は CorePushManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。

  • – unregisterDeviceToken

    CORE PUSHからデバイストークンを削除する
    デバイストークン削除時に UserDefaults の CPDeviceTokenキー に保存されたデバイストークンを空文字で保存します。
    デバイストークンの削除が成功した場合は CorePushManagerUnregisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に通知を行います。
    デバイストークンの削除が失敗した場合は CorePushManagerUnregisterTokenRequestFailNotification の通知キーで NSNotificationCenter に通知を行います。

  • – registerUserAttributes:api:

    指定のURLにユーザー属性を送信する。

  • – handleRemoteNotification:

    アプリがフォアグランド・バックグランド状態で動作中に通知を受信した時の動作を定義する。
    バックラウンド状態で通知を受信後に通知からアプリを起動した場合、 CorePushManagerDelegate#handleBackgroundNotificationが呼び出されます。
    フォアグランド状態で通知を受信した場合、CorePushManagerDelegate#handleForegroundNotificationが呼び出されます。

  • – handleLaunchingNotificationWithOption:

    アプリのプロセスが起動していない状態で通知からアプリを起動した時の処理を定義する。
    launchOptionsに通知のUserInfoが存在する場合は、CorePushManagerDelegate#handleLaunchingNotificationを 呼び出し、存在しない場合は何も行わない。

  • – handleBackgroundNotification:

    アプリがバックグランドで動作中に通知からアプリを起動した時に CorePushManager#handleRemoteNotification から呼び出されます。

  • – handleForegroundNotifcation:

    アプリがフォアグランドで動作中に通知を受信した時に CorePushManager#handleRemoteNotification から呼び出されます。

  • – handleLaunchingNotification:

    アプリのプロセスが起動していない状態で通知からアプリを起動した時に CorePushManager#handleLaunchingNotificationWithOption から呼び出されます。

  • + resetApplicationIconBadgeNumber

    アプリケーションアイコンのバッジ数をリセットする

  • + setApplicationIconBadgeNumber:

    アプリケーションアイコンのバッジ数を設定する。

  • – registerTokenRequestSuccess

    CORE PUSHからデバイストークンの登録が成功した時に呼ばれる

  • – registerTokenRequestFail

    CORE PUSHからデバイストークンの登録が失敗した時に呼ばれる

  • – unregisterTokenRequestSuccess

    CORE PUSHからデバイストークンの削除が成功した時に呼ばれる

  • – unregisterTokenRequestFail

    CORE PUSHからデバイストークンの削除が失敗した時に呼ばれる

  • – registerUserAttributesRequestSuccess

    CORE PUSHからデバイストークンの登録が成功した時に呼ばれる

  • – registerUserAttributesRequestFail

    CORE PUSHからデバイストークンの登録が失敗した時に呼ばれる

  • – reportCurrentLocation

    現在の位置情報を送信する

Other Methods

  •   configKey

    CORE PUSHのコンフィグキーを設定する

    property
  •   pushEnabled

    CORE PUSHの通知設定の有無を設定する

    property
  •   debugEnabled

    CORE PUSHのデバッグログを出力する

    property
  •   deviceIdEnabled

    デバイスIDをCORE PUSHサーバに送信するかを設定する。

    property
  •   deviceIdHashEnabled

    デバイスIDをMD5ハッシュ化の有無を設定する。

    property
  •   categoryIds

    CORE PUSHのカテゴリIDを設定する。

    property
  •   multiCategoryIds

    CORE PUSHのカテゴリIDを設定する。

    property
  •   appUserId

    CORE PUSHのユーザーIDを設定する。 @param アプリのユーザーID。

    property
  •   delegate

    CorePushManagerDelegateプロトコルを実装したクラス

    property

Properties

appUserId

CORE PUSHのユーザーIDを設定する。 @param アプリのユーザーID。

@property (nonatomic, retain) NSString *appUserId

Declared In

CorePushManager.h

categoryIds

CORE PUSHのカテゴリIDを設定する。

@property (nonatomic, retain) NSMutableArray *categoryIds

Parameters

categoryIds

カテゴリIDの配列

Declared In

CorePushManager.h

configKey

CORE PUSHのコンフィグキーを設定する

@property (nonatomic, retain) NSString *configKey

Parameters

configKey

CORE PUSHのコンフィグキーの値。
指定したコンフィグキーは UserDefaultsに CorePushConfigKey のキーで保存されます。

Declared In

CorePushManager.h

debugEnabled

CORE PUSHのデバッグログを出力する

@property (nonatomic, assign) BOOL debugEnabled

Parameters

debugEnable

デバッグログを出力する場合は YES、出力しない場合は NOを設定する

Declared In

CorePushManager.h

delegate

CorePushManagerDelegateプロトコルを実装したクラス

@property (nonatomic, assign) id<CorePushManagerDelegate> delegate

Declared In

CorePushManager.h

deviceIdEnabled

デバイスIDをCORE PUSHサーバに送信するかを設定する。

@property (nonatomic, assign) BOOL deviceIdEnabled

Parameters

deviceIdEnabled。デバイスIDを送信する場合は

YES、送信しない場合は NOを設定する。デフォルト値は NO。

Declared In

CorePushManager.h

deviceIdHashEnabled

デバイスIDをMD5ハッシュ化の有無を設定する。

@property (nonatomic, assign) BOOL deviceIdHashEnabled

Parameters

deviceIdHashEnabled

ハッシュ化する場合は YES、ハッシュ化しない場合はNOを設定する。デフォルト値は NO。

Declared In

CorePushManager.h

multiCategoryIds

CORE PUSHのカテゴリIDを設定する。

@property (nonatomic, retain) NSMutableDictionary *multiCategoryIds

Parameters

categoryIds

カテゴリIDのディクショナリ。カテゴリIDをキーにサブカテゴリID の配列を指定。

Declared In

CorePushManager.h

pushEnabled

CORE PUSHの通知設定の有無を設定する

@property (nonatomic, assign) BOOL pushEnabled

Parameters

pushEnabled

CORE PUSHの通知設定が有効な場合は YES、無効な場合は NO を設定する。
指定した値は UserDefaultsに CorePushPushEnabledKey のキーで保存されます。

Declared In

CorePushManager.h

Class Methods

resetApplicationIconBadgeNumber

アプリケーションアイコンのバッジ数をリセットする

+ (void)resetApplicationIconBadgeNumber

Declared In

CorePushManager.h

setApplicationIconBadgeNumber:

アプリケーションアイコンのバッジ数を設定する。

+ (void)setApplicationIconBadgeNumber:(int)number

Parameters

number

バッジ数

Declared In

CorePushManager.h

shared

シングルトンインスタンスの生成

+ (id)shared

Declared In

CorePushManager.h

Instance Methods

handleBackgroundNotification:

アプリがバックグランドで動作中に通知からアプリを起動した時に CorePushManager#handleRemoteNotification から呼び出されます。

- (void)handleBackgroundNotification:(NSDictionary *)userInfo

Parameters

userInfo

通知情報を含むオブジェクト

Declared In

CorePushManager.h

handleForegroundNotifcation:

アプリがフォアグランドで動作中に通知を受信した時に CorePushManager#handleRemoteNotification から呼び出されます。

- (void)handleForegroundNotifcation:(NSDictionary *)userInfo

Parameters

userInfo

通知情報を含むオブジェクト

Declared In

CorePushManager.h

handleLaunchingNotification:

アプリのプロセスが起動していない状態で通知からアプリを起動した時に CorePushManager#handleLaunchingNotificationWithOption から呼び出されます。

- (void)handleLaunchingNotification:(NSDictionary *)userInfo

Parameters

userInfo

通知情報を含むオブジェクト

Declared In

CorePushManager.h

handleLaunchingNotificationWithOption:

アプリのプロセスが起動していない状態で通知からアプリを起動した時の処理を定義する。
launchOptionsに通知のUserInfoが存在する場合は、CorePushManagerDelegate#handleLaunchingNotificationを 呼び出し、存在しない場合は何も行わない。

- (void)handleLaunchingNotificationWithOption:(NSDictionary *)launchOptions

Parameters

launchOptions

起動オプション。UIApplicationLaunchOptionsRemoteNotificationKeyをキーにUserInfoオブジェクトを取得する

Declared In

CorePushManager.h

handleRemoteNotification:

アプリがフォアグランド・バックグランド状態で動作中に通知を受信した時の動作を定義する。
バックラウンド状態で通知を受信後に通知からアプリを起動した場合、 CorePushManagerDelegate#handleBackgroundNotificationが呼び出されます。
フォアグランド状態で通知を受信した場合、CorePushManagerDelegate#handleForegroundNotificationが呼び出されます。

- (void)handleRemoteNotification:(NSDictionary *)userInfo

Parameters

userInfo

通知の情報を含むオブジェクト

Declared In

CorePushManager.h

registerDeviceToken:

CORE PUSHにデバイストークンを登録する。
変換したデバイストークンの文字列は UserDefaultsに CorePushDeviceTokenKeyキー で保存されます。
デバイストークンの登録が成功した場合は CorePushManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に 通知を行います。
デバイストークンの登録が失敗した場合は CorePushManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。

- (void)registerDeviceToken:(NSData *)token

Parameters

token

APNSサーバから取得したデバイストークンのバイト列。

Declared In

CorePushManager.h

registerDeviceTokenString:

CORE PUSHにデバイストークンを登録する。
変換したデバイストークンの文字列は UserDefaultsに CorePushDeviceTokenKeyキー で保存されます。
デバイストークンの登録が成功した場合は CorePushManagerRegisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に 通知を行います。
デバイストークンの登録が失敗した場合は CorePushManagerRegisterTokenRequestFailNotification の通知キーで NSNotificationCenterに通知を行います。

- (void)registerDeviceTokenString:(NSString *)token

Parameters

token

APNSサーバから取得したデバイストークンの文字列。

Declared In

CorePushManager.h

registerForRemoteNotificationTypes:

APNSの通知サービスにデバイスを登録する。

- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types

Parameters

types

通知タイプ

Declared In

CorePushManager.h

registerForRemoteNotifications

APNSの通知サービスにデバイスを登録する。 デフォルトでは通知のアラート、バッジ、サウンドをONに設定

- (void)registerForRemoteNotifications

Declared In

CorePushManager.h

registerTokenRequestFail

CORE PUSHからデバイストークンの登録が失敗した時に呼ばれる

- (void)registerTokenRequestFail

Declared In

CorePushRegisterTokenRequest.h

registerTokenRequestSuccess

CORE PUSHからデバイストークンの登録が成功した時に呼ばれる

- (void)registerTokenRequestSuccess

Declared In

CorePushRegisterTokenRequest.h

registerUserAttributes:api:

指定のURLにユーザー属性を送信する。

- (void)registerUserAttributes:(NSArray *)attributes api:(NSString *)url

Parameters

attributes

ユーザー属性の配列

url

ユーザー属性を送信するurl

Declared In

CorePushManager.h

registerUserAttributesRequestFail

CORE PUSHからデバイストークンの登録が失敗した時に呼ばれる

- (void)registerUserAttributesRequestFail

Declared In

CorePushManager.m

registerUserAttributesRequestSuccess

CORE PUSHからデバイストークンの登録が成功した時に呼ばれる

- (void)registerUserAttributesRequestSuccess

Declared In

CorePushManager.m

reportCurrentLocation

現在の位置情報を送信する

- (void)reportCurrentLocation

Declared In

CorePushManager.m

setAppUserId:

CORE PUSHのユーザーIDを設定する。 @param アプリのユーザーID。

- (void)setAppUserId:(NSString *)appUserId

Declared In

CorePushManager.h

setCategoryIds:

CORE PUSHのカテゴリIDを設定する。

- (void)setCategoryIds:(NSMutableArray *)categoryIds

Parameters

categoryIds

カテゴリIDの配列

Declared In

CorePushManager.h

setConfigKey:

CORE PUSHのコンフィグキーを設定する

- (void)setConfigKey:(NSString *)configKey

Parameters

configKey

CORE PUSHのコンフィグキーの値。
指定したコンフィグキーは UserDefaultsに CorePushConfigKey のキーで保存されます。

Declared In

CorePushManager.h

setDebugEnabled:

CORE PUSHのデバッグログを出力する

- (void)setDebugEnabled:(BOOL)debugEnabled

Parameters

debugEnable

デバッグログを出力する場合は YES、出力しない場合は NOを設定する

Declared In

CorePushManager.h

setDeviceIdEnabled:

デバイスIDをCORE PUSHサーバに送信するかを設定する。

- (void)setDeviceIdEnabled:(BOOL)deviceIdEnabled

Parameters

deviceIdEnabled。デバイスIDを送信する場合は

YES、送信しない場合は NOを設定する。デフォルト値は NO。

Declared In

CorePushManager.h

setDeviceIdHashEnabled:

デバイスIDをMD5ハッシュ化の有無を設定する。

- (void)setDeviceIdHashEnabled:(BOOL)deviceIdHashEnabled

Parameters

deviceIdHashEnabled

ハッシュ化する場合は YES、ハッシュ化しない場合はNOを設定する。デフォルト値は NO。

Declared In

CorePushManager.h

setMultiCategoryIds:

CORE PUSHのカテゴリIDを設定する。

- (void)setMultiCategoryIds:(NSMutableDictionary *)multiCategoryIds

Parameters

categoryIds

カテゴリIDのディクショナリ。カテゴリIDをキーにサブカテゴリID の配列を指定。

Declared In

CorePushManager.h

setPushEnabled:

CORE PUSHの通知設定の有無を設定する

- (void)setPushEnabled:(BOOL)pushEnabled

Parameters

pushEnabled

CORE PUSHの通知設定が有効な場合は YES、無効な場合は NO を設定する。
指定した値は UserDefaultsに CorePushPushEnabledKey のキーで保存されます。

Declared In

CorePushManager.h

unregisterDeviceToken

CORE PUSHからデバイストークンを削除する
デバイストークン削除時に UserDefaults の CPDeviceTokenキー に保存されたデバイストークンを空文字で保存します。
デバイストークンの削除が成功した場合は CorePushManagerUnregisterTokenRequestSuccessNotification の通知キーで NSNotificationCenter に通知を行います。
デバイストークンの削除が失敗した場合は CorePushManagerUnregisterTokenRequestFailNotification の通知キーで NSNotificationCenter に通知を行います。

- (void)unregisterDeviceToken

Declared In

CorePushManager.h

unregisterTokenRequestFail

CORE PUSHからデバイストークンの削除が失敗した時に呼ばれる

- (void)unregisterTokenRequestFail

Declared In

CorePushUnregisterTokenRequest.h

unregisterTokenRequestSuccess

CORE PUSHからデバイストークンの削除が成功した時に呼ばれる

- (void)unregisterTokenRequestSuccess

Declared In

CorePushUnregisterTokenRequest.h