Skip to content

Commit

Permalink
Carnival iOS SDK 5.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnivalBot committed Jul 6, 2016
1 parent 6f942c4 commit fff9466
Show file tree
Hide file tree
Showing 69 changed files with 972 additions and 13 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#import "CarnivalMessageStream.h"
#import "CarnivalAttributes.h"

#define CARNIVAL_VERSION @"5.1.0"
#define CARNIVAL_VERSION @"5.1.1"

/* Constants for Auto-Analytics Tracking */
NS_ASSUME_NONNULL_BEGIN
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Carnival.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Carnival'
s.version = '5.1.0'
s.version = '5.1.1'
s.summary = 'Carnival iOS SDK for integrating with http://carnival.io messaging and analytics service.'
s.author = {
'Carnival Mobile' => '[email protected]'
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
//
// CarnivalAttributes.h
// Carnival
//
// Created by Sam Jarman on 4/21/16.
// Copyright © 2016 Carnival Labs . All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, CarnivalAttributesMergeRule) {
CarnivalAttributesMergeRuleUpdate,
CarnivalAttributesMergeRuleReplace
};

/**
* Use this class to construct an object which you can then pass to the setAttributes: method. You can set as many objects with keys as you like.
* Attributes can update existing attributes set (merge) or can completely replace them with a new set. Use the setAttributesMergeRule for this. The default behaviour is merge.
* Null values will remove the value for the given key.
* To completly clear all values, set a newly instantiated CarnivalAttributes object with the merge sule set to CarnivalAttributesMergeRuleReplace.
*/
@interface CarnivalAttributes : NSObject

/**
* Sets a string object for a given key. The key must not be nil.
*
* @param string The string to set.
* @param key The key to set.
*/
- (void)setString:(nullable NSString *)string forKey:(nonnull NSString *)key;

/**
* Sets an array of string objects for a given key. All items in the array must be of type NSString. The key must not be nil.
*
* @param strings The array of strings to set.
* @param key The key to set.
*/
- (void)setStrings:(nullable NSArray<NSString *> *)strings forKey:(nonnull NSString *)key;

/**
* Sets a date objects for a given key. The key must not be nil.
*
* @param date The date to set.
* @param key The key to set.
*/
- (void)setDate:(nullable NSDate *)date forKey:(nonnull NSString *)key;

/**
* Sets an array of date objects for a given key. All items in the array must be of type NSDate. The key must not be nil.
*
* @param dates The array of dates to set.
* @param key The key to set.
*/
- (void)setDates:(nullable NSArray<NSDate *> *)dates forKey:(nonnull NSString *)key;

/**
* Sets an integer object for a given key. The key must not be nil.
*
* @param integer The integer to set.
* @param key The key to set.
*/
- (void)setInteger:(NSInteger)integer forKey:(nonnull NSString *)key;


/**
* Sets an array of integers objects for a given key. All items in the array must be of type NSNumber (constructed with an NSInteger). The key must not be nil.
*
* @param integers The array of integers to set.
* @param key The key to set.
*/
- (void)setIntegers:(nullable NSArray<NSNumber *> *)integers forKey:(nonnull NSString *)key;

/**
* Sets a boolean object for a given key. The key must not be nil.
*
* @param aBool The boolean to set.
* @param key The key to set.
*/
- (void)setBool:(BOOL)aBool forKey:(nonnull NSString *)key;

/**
* Sets a float object for a given key. The key must not be nil.
*
* @param aFloaat The float to set.
* @param key The key to set.
*/
- (void)setFloat:(CGFloat)aFloat forKey:(nonnull NSString *)key;

/**
* Sets an array of floats objects for a given key. All items in the array must be of type NSNumber (constructed with a CGFloat). The key must not be nil.
*
* @param floats The array of floats to set.
* @param key The key to set.
*/
- (void)setFloats:(nullable NSArray<NSNumber *> *)floats forKey:(nonnull NSString *)key;

/**
* Sets the method of merging on the attributes. CarnivalAttributesMergeRuleUpdate will merge with existing attributes and CarnivalAttributesMergeRuleReplace will replace all data with the new set.
*
* @param mergeRule The CarnivalAttributesMergeRule to use. The default is update.
*/
- (void)setAttributesMergeRule:(CarnivalAttributesMergeRule)mergeRule;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
//
// CarnivalMessage.h
// Carnival
//
// Created by Carnival Mobile
// Copyright (c) 2015 Carnival Mobile. All rights reserved.
//
// For documentation see http://docs.carnival.io
//

#import <Foundation/Foundation.h>

/**
* Declares which type the Carnival Message is. Types are defined at time of authoring.
**/
typedef NS_ENUM(NSInteger, CarnivalMessageType) {
CarnivalMessageTypeText,
CarnivalMessageTypeImage,
CarnivalMessageTypeLink,
CarnivalMessageTypeVideo,
CarnivalMessageTypeFakeCall,
CarnivalMessageTypeStandardPush,
CarnivalMessageTypeOther
};

@interface CarnivalMessage : NSObject

/**
* The time at which the message was created.
*/
@property (nonatomic, strong, nonnull) NSDate *createdAt;

/**
* The unique ID of the message.
*/
@property (nonatomic, strong, nonnull) NSString *messageID;

/**
* The body text of the message.
*/
@property (nonatomic, strong, nullable) NSString *text;

/**
* The body text of the message rendered into HTML.
*/
@property (nonatomic, strong, nullable) NSString *htmlText;

/**
* The title of the message.
*/
@property (nonatomic, strong, nonnull) NSString *title;

/**
* The type of the message.
*/
@property (nonatomic, assign) CarnivalMessageType type;

/**
* The URL of the image attached to the message. Nil if no image attached.
*/
@property (nonatomic, strong, nullable) NSURL *imageURL;

/**
* The URL attached to the message. Nil if no URL attached.
*/
@property (nonatomic, strong, nullable) NSURL *URL;

/**
* The URL of the video attached to the message. Nil if no video attached.
*/
@property (nonatomic, strong, nullable) NSURL *videoURL;

/**
* Whether or not the message has been marked as read.
*/
@property (nonatomic, assign, readonly, getter=isRead) BOOL read;


/**
* A dictionary of arbitary attributes set on the message.
*/
@property (nonatomic, strong, nullable) NSDictionary *attributes;


/**
* Whether or not a message had a push attached.
*/
@property (nonatomic, assign, readonly, getter=hasPushAttached) BOOL pushAttached;

@end
Loading

0 comments on commit fff9466

Please sign in to comment.