{"_id":"57bc549336eff81700666890","parentDoc":null,"user":"57bc3654b9c7f0220009c77b","category":{"_id":"55781fe35129590d003ff4fb","version":"55781fe25129590d003ff4f7","__v":11,"pages":["55781fe45129590d003ff517","55781fe45129590d003ff518","55781fe45129590d003ff519","55781fe45129590d003ff51a","55781fe45129590d003ff51b","55781fe45129590d003ff51c","55781fe45129590d003ff51d","55781fe45129590d003ff51e","55781fe45129590d003ff51f","55781fe45129590d003ff520","55781fe45129590d003ff521","55781fe45129590d003ff522","5579ab5fc7fb3f2100096fad","55f7de1660cc850d008a7a22","55f7e1fbe32e9b0d00a2d4d0","561f72bacec1a50d00979598","561f764f61c0521700acc428","563337539c607719001b85dd","564318f1f49bfa0d002f5566","564f03454f000617007bd670","565ee80a23fd5f0d00a129f9","56793cd73473bc0d008e141b"],"project":"54aa7f773b56130b0056c86e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-05T12:43:51.897Z","from_sync":false,"order":3,"slug":"ios-sdk","title":"iOS SDK"},"version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":6,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"__v":1,"githubsync":"","project":"54aa7f773b56130b0056c86e","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-08-23T13:50:11.768Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":19,"body":"[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \":::at:::interface PULPulsateManager : NSObject\\n\\n@property (nonnull, nonatomic, retain) IBOutlet id<PULPulsateUnauthorizedManagerDelegate> unauthorizedDelegate;\\n@property (nonnull, nonatomic, retain) IBOutlet id<PULPulsateBadgeDelegate> badgeDelegate;\\n\\ntypedef void(^RequestListener)(BOOL success, NSError* _Nullable error);\\ntypedef NS_ENUM(NSUInteger, PULUserGender){\\n    PULMale,\\n    PULFemale\\n};\\n\\ntypedef NS_ENUM(NSUInteger, PULPrivacyLevel){\\n    PULPrivacySubscribed,\\n    PULPrivacyUnsubscribed\\n};\\n\\n/**\\n *  Starts Pulsate session lifecycle. If location and push were set as enabled it'll show the prompts to the user.\\n *  Session starts when the app enters foreground and ends when it goes to background.\\n */\\n-(void)startPulsateSession:(nullable RequestListener)listener;\\n\\n/**\\n *  Starts Pulsate session lifecycle for given user (alias). If location and push were set as enabled it'll show the prompts to the user.\\n *  Session starts when the app enters foreground and ends when it goes to background.\\n */\\n-(void)startPulsateSessionForAlias:(nonnull NSString*)alias withListener:(nonnull RequestListener)listener;\\n\\n/**\\n * Logs out the current user\\n */\\n-(void)logout:(nonnull RequestListener)listener;\\n\\n/**\\n *  Returns the Device Guid that Pulsate uses to identify users.\\n */\\n-(nonnull NSString*)getDeviceGuid;\\n\\n/**\\n *  Updates the user's first name. Gets updated when entering background.\\n *\\n *  @param firstName firstName - can't be nil\\n */\\n-(void)updateFirstName:(nonnull NSString*)firstName;\\n\\n/**\\n *  Updates the user's last name. Gets updated when entering background.\\n *\\n *  @param lastName lastName - can't be nil\\n */\\n-(void)updateLastName:(nonnull NSString*)lastName;\\n\\n/**\\n *  Updates the user's email. Gets updated when entering background.\\n *\\n *  @param email email - can't be nil\\n */\\n-(void)updateEmail:(nonnull NSString*)email;\\n\\n/**\\n *  Updates user's age. Gets updated when entering background.\\n *\\n *  @param age user's age\\n */\\n-(void)updateAge:(NSUInteger)age;\\n\\n/**\\n *  Updates user's gender. Gets updated when entering background.\\n *\\n *  @param gender user's gender\\n */\\n-(void)updateGender:(PULUserGender)gender;\\n\\n/**\\n *  Disables or Enables push notifications for Pulsate\\n *\\n *  @param disable user's push notification preference\\n */\\n-(void)setPushNotificationEnabled:(BOOL)enabled;\\n\\n-(BOOL)isPushNotificationEnabled;\\n\\n/**\\n *  Sets user's privacy settings.\\n *\\n *  @param privacyLevel user's privacy level\\n */\\n-(void)setPrivacy:(PULPrivacyLevel)privacyLevel;\\n\\n/**\\n *  Creates a custom attribute with a string. Neither can be nil. Gets updated when entering background.\\n *\\n *  @param propertyName custom attribute name\\n *  @param value        attribute value\\n */\\n-(void)createAttribute:(nonnull NSString *)propertyName withString:(nonnull NSString *)value;\\n\\n/**\\n *  Creates a custom attribute with a float. Key can't be nil. Gets updated when entering background.\\n *\\n *  @param propertyName custom attribute name\\n *  @param number       attribute value\\n */\\n-(void)createAttribute:(nonnull NSString *)propertyName withFloat:(CGFloat)number;\\n\\n/**\\n *  Creates a custom attribute with an integer. Key can't be nil. Gets updated when entering background.\\n *\\n *  @param propertyName custom attribute name\\n *  @param number       attribute value\\n */\\n-(void)createAttribute:(nonnull NSString *)propertyName withInteger:(NSInteger)number;\\n\\n/**\\n *  Creates custom attribute with a bool. Key can't be nil. Gets updated when entering background.\\n *\\n *  @param propertyName custom attribute name\\n *  @param boolean      attribute value\\n */\\n-(void)createAttribute:(nonnull NSString *)propertyName withBoolean:(BOOL)boolean;\\n\\n/**\\n *  Creates custom attribute with a date. Key can't be nil. Gets updated when entering background.\\n *\\n *  @param propertyName custom attribute name\\n *  @param date         attribute value\\n */\\n-(void)createAttribute:(nonnull NSString *)propertyName withDate:(nonnull NSDate*)date;\\n\\n/**\\n *  Increments given integer attribute by given value. Gets updated when entering background.\\n *\\n *  @param attributeName which attribute to increment\\n *  @param value         value to increment by\\n */\\n-(void)incrementIntegerAttribute:(nonnull NSString*)attributeName withInteger:(NSInteger)value;\\n\\n/**\\n *  Decrements given integer attribute by given. Gets updated when entering background.\\n *\\n *  @param attributeName custom attribute name\\n *  @param value         attribute value\\n */\\n-(void)decrementIntegerAttribute:(nonnull NSString*)attributeName withInteger:(NSInteger)value;\\n\\n/**\\n *  Increments given float attribute with given value. Gets updated when entering background.\\n *\\n *  @param attributeName custom attribute name\\n *  @param value         attribute value\\n */\\n-(void)incrementFloatAttribute:(nonnull NSString*)attributeName withFloat:(CGFloat)value;\\n\\n/**\\n *  Decrements given float attribute with given value. Gets updated when entering background.\\n *\\n *  @param attributeName custom attribute name\\n *  @param value         attribute value\\n */\\n-(void)decrementFloatAttribute:(nonnull NSString*)attributeName withFloat:(CGFloat)value;\\n\\n/**\\n *  If you chose to have location disabled when instantiating the Pulsate Manager, you can enable it later.\\n *  This enables you to postpone the location query prompt.\\n */\\n-(void)startLocation;\\n\\n/**\\n *  If you chose to have push disabled when instantiating the Pulsate Manager, you can enable it later.\\n *  This enables you to postpone the push query prompt.\\n */\\n-(void)startRemoteNotifications;\\n\\n/**\\n *  If you chose to have push disabled when instantiating the Pulsate Manager, you can enable it later.\\n *  This enables you to postpone the push query prompt and customize the push settings\\n */\\n-(void)startRemoteNotificationsWithSettings:(nonnull UIUserNotificationSettings*)notificationSettings;\\n\\n/**\\n *  Creates and returns a Pulsate Feeed Navigation Controller. You can choose to present it however you see fit.\\n *\\n */\\n-(nonnull UINavigationController*)getFeedNavigationController;\\n\\n/**\\n * If feed is opened automatically (by pressing a push notification for example) you might want to\\n * hide it programatically.\\n */\\n-(void)closeAutomaticallyOpenedFeed;\\n\\n/**\\n *  Sends a custom in app event\\n *\\n *  @param event event to be sent - can't be nil\\n */\\n-(void)createEvent:(nonnull NSString*)event;\\n\\n/**\\n * Attributes synchronize when the app is entering background. This method forces the synchronization to happen instantly.\\n */\\n-(void)forceAttributeSync;\\n\\n/**\\n *  Sets the create thread button in feed visibility.\\n *\\n *  @param buttonEnabled decides if the button should be enabled\\n */\\n-(void)setNewThreadButtonEnabled:(BOOL)buttonEnabled;\\n\\n/**\\n *  Decides if beacon actions should be sent with a location. The default is NO.\\n */\\n-(void)sendLocationWithBeaconEvents:(BOOL)sendLocation;\\n\\n/**\\n * Enables or Disables the Geofencing and Beacon Scanning.\\n * By default enabled.\\n */\\n-(void)setLocationUpdatesEnabled:(BOOL)enabled;\\n\\n/**\\n * \\n *\\n */\\n-(BOOL)isUserAuthorized;\\n\\n/**\\n *  Enables or Disables In-App Notifications. Default - YES.\\n */\\n-(void)enableInAppNotification:(BOOL)enabled;\\n\\n/**\\n *  Set if user is authorized or not. The default is YES.\\n */\\n-(void)setUserAuthorized:(BOOL)authorized;\\n\\n/**\\n *  Sends a request to the server to get the Pulsate badge count.\\n *  The badge count will be returned in the PULPulsateBadgeDelegate badgeUpdated callback.\\n */\\n-(void)getBadgeCount;\\n\\n/**\\n *  Shows the last in app notification. In App Notification need to be enabled.\\n *  To enable in app notifications use enableInAppNotification(BOOL).\\n */\\n-(void)showLastInAppNotification;\\n\\n/**\\n *  Shows the last blocked message or card. User must be authorized.\\n *  To authorize a user use setUserAuthorized(BOOL).\\n */\\n-(void)showLastUnauthorizedMessage;\\n\\n/**\\n *  Shows the last in app notification. In App Notification need to be enabled.\\n *  To enable in app notifications use enableInAppNotification(BOOL).\\n */\\n-(nonnull id<UIApplicationDelegate, UNUserNotificationCenterDelegate>)getPulsateSystemManager;\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"pulsatemanager-methods-1","type":"basic","title":"PulsateManager Methods"}

PulsateManager Methods


[block:code] { "codes": [ { "code": "@interface PULPulsateManager : NSObject\n\n@property (nonnull, nonatomic, retain) IBOutlet id<PULPulsateUnauthorizedManagerDelegate> unauthorizedDelegate;\n@property (nonnull, nonatomic, retain) IBOutlet id<PULPulsateBadgeDelegate> badgeDelegate;\n\ntypedef void(^RequestListener)(BOOL success, NSError* _Nullable error);\ntypedef NS_ENUM(NSUInteger, PULUserGender){\n PULMale,\n PULFemale\n};\n\ntypedef NS_ENUM(NSUInteger, PULPrivacyLevel){\n PULPrivacySubscribed,\n PULPrivacyUnsubscribed\n};\n\n/**\n * Starts Pulsate session lifecycle. If location and push were set as enabled it'll show the prompts to the user.\n * Session starts when the app enters foreground and ends when it goes to background.\n */\n-(void)startPulsateSession:(nullable RequestListener)listener;\n\n/**\n * Starts Pulsate session lifecycle for given user (alias). If location and push were set as enabled it'll show the prompts to the user.\n * Session starts when the app enters foreground and ends when it goes to background.\n */\n-(void)startPulsateSessionForAlias:(nonnull NSString*)alias withListener:(nonnull RequestListener)listener;\n\n/**\n * Logs out the current user\n */\n-(void)logout:(nonnull RequestListener)listener;\n\n/**\n * Returns the Device Guid that Pulsate uses to identify users.\n */\n-(nonnull NSString*)getDeviceGuid;\n\n/**\n * Updates the user's first name. Gets updated when entering background.\n *\n * @param firstName firstName - can't be nil\n */\n-(void)updateFirstName:(nonnull NSString*)firstName;\n\n/**\n * Updates the user's last name. Gets updated when entering background.\n *\n * @param lastName lastName - can't be nil\n */\n-(void)updateLastName:(nonnull NSString*)lastName;\n\n/**\n * Updates the user's email. Gets updated when entering background.\n *\n * @param email email - can't be nil\n */\n-(void)updateEmail:(nonnull NSString*)email;\n\n/**\n * Updates user's age. Gets updated when entering background.\n *\n * @param age user's age\n */\n-(void)updateAge:(NSUInteger)age;\n\n/**\n * Updates user's gender. Gets updated when entering background.\n *\n * @param gender user's gender\n */\n-(void)updateGender:(PULUserGender)gender;\n\n/**\n * Disables or Enables push notifications for Pulsate\n *\n * @param disable user's push notification preference\n */\n-(void)setPushNotificationEnabled:(BOOL)enabled;\n\n-(BOOL)isPushNotificationEnabled;\n\n/**\n * Sets user's privacy settings.\n *\n * @param privacyLevel user's privacy level\n */\n-(void)setPrivacy:(PULPrivacyLevel)privacyLevel;\n\n/**\n * Creates a custom attribute with a string. Neither can be nil. Gets updated when entering background.\n *\n * @param propertyName custom attribute name\n * @param value attribute value\n */\n-(void)createAttribute:(nonnull NSString *)propertyName withString:(nonnull NSString *)value;\n\n/**\n * Creates a custom attribute with a float. Key can't be nil. Gets updated when entering background.\n *\n * @param propertyName custom attribute name\n * @param number attribute value\n */\n-(void)createAttribute:(nonnull NSString *)propertyName withFloat:(CGFloat)number;\n\n/**\n * Creates a custom attribute with an integer. Key can't be nil. Gets updated when entering background.\n *\n * @param propertyName custom attribute name\n * @param number attribute value\n */\n-(void)createAttribute:(nonnull NSString *)propertyName withInteger:(NSInteger)number;\n\n/**\n * Creates custom attribute with a bool. Key can't be nil. Gets updated when entering background.\n *\n * @param propertyName custom attribute name\n * @param boolean attribute value\n */\n-(void)createAttribute:(nonnull NSString *)propertyName withBoolean:(BOOL)boolean;\n\n/**\n * Creates custom attribute with a date. Key can't be nil. Gets updated when entering background.\n *\n * @param propertyName custom attribute name\n * @param date attribute value\n */\n-(void)createAttribute:(nonnull NSString *)propertyName withDate:(nonnull NSDate*)date;\n\n/**\n * Increments given integer attribute by given value. Gets updated when entering background.\n *\n * @param attributeName which attribute to increment\n * @param value value to increment by\n */\n-(void)incrementIntegerAttribute:(nonnull NSString*)attributeName withInteger:(NSInteger)value;\n\n/**\n * Decrements given integer attribute by given. Gets updated when entering background.\n *\n * @param attributeName custom attribute name\n * @param value attribute value\n */\n-(void)decrementIntegerAttribute:(nonnull NSString*)attributeName withInteger:(NSInteger)value;\n\n/**\n * Increments given float attribute with given value. Gets updated when entering background.\n *\n * @param attributeName custom attribute name\n * @param value attribute value\n */\n-(void)incrementFloatAttribute:(nonnull NSString*)attributeName withFloat:(CGFloat)value;\n\n/**\n * Decrements given float attribute with given value. Gets updated when entering background.\n *\n * @param attributeName custom attribute name\n * @param value attribute value\n */\n-(void)decrementFloatAttribute:(nonnull NSString*)attributeName withFloat:(CGFloat)value;\n\n/**\n * If you chose to have location disabled when instantiating the Pulsate Manager, you can enable it later.\n * This enables you to postpone the location query prompt.\n */\n-(void)startLocation;\n\n/**\n * If you chose to have push disabled when instantiating the Pulsate Manager, you can enable it later.\n * This enables you to postpone the push query prompt.\n */\n-(void)startRemoteNotifications;\n\n/**\n * If you chose to have push disabled when instantiating the Pulsate Manager, you can enable it later.\n * This enables you to postpone the push query prompt and customize the push settings\n */\n-(void)startRemoteNotificationsWithSettings:(nonnull UIUserNotificationSettings*)notificationSettings;\n\n/**\n * Creates and returns a Pulsate Feeed Navigation Controller. You can choose to present it however you see fit.\n *\n */\n-(nonnull UINavigationController*)getFeedNavigationController;\n\n/**\n * If feed is opened automatically (by pressing a push notification for example) you might want to\n * hide it programatically.\n */\n-(void)closeAutomaticallyOpenedFeed;\n\n/**\n * Sends a custom in app event\n *\n * @param event event to be sent - can't be nil\n */\n-(void)createEvent:(nonnull NSString*)event;\n\n/**\n * Attributes synchronize when the app is entering background. This method forces the synchronization to happen instantly.\n */\n-(void)forceAttributeSync;\n\n/**\n * Sets the create thread button in feed visibility.\n *\n * @param buttonEnabled decides if the button should be enabled\n */\n-(void)setNewThreadButtonEnabled:(BOOL)buttonEnabled;\n\n/**\n * Decides if beacon actions should be sent with a location. The default is NO.\n */\n-(void)sendLocationWithBeaconEvents:(BOOL)sendLocation;\n\n/**\n * Enables or Disables the Geofencing and Beacon Scanning.\n * By default enabled.\n */\n-(void)setLocationUpdatesEnabled:(BOOL)enabled;\n\n/**\n * \n *\n */\n-(BOOL)isUserAuthorized;\n\n/**\n * Enables or Disables In-App Notifications. Default - YES.\n */\n-(void)enableInAppNotification:(BOOL)enabled;\n\n/**\n * Set if user is authorized or not. The default is YES.\n */\n-(void)setUserAuthorized:(BOOL)authorized;\n\n/**\n * Sends a request to the server to get the Pulsate badge count.\n * The badge count will be returned in the PULPulsateBadgeDelegate badgeUpdated callback.\n */\n-(void)getBadgeCount;\n\n/**\n * Shows the last in app notification. In App Notification need to be enabled.\n * To enable in app notifications use enableInAppNotification(BOOL).\n */\n-(void)showLastInAppNotification;\n\n/**\n * Shows the last blocked message or card. User must be authorized.\n * To authorize a user use setUserAuthorized(BOOL).\n */\n-(void)showLastUnauthorizedMessage;\n\n/**\n * Shows the last in app notification. In App Notification need to be enabled.\n * To enable in app notifications use enableInAppNotification(BOOL).\n */\n-(nonnull id<UIApplicationDelegate, UNUserNotificationCenterDelegate>)getPulsateSystemManager;", "language": "objectivec" } ] } [/block]