Skip to content

Commit

Permalink
fix json model problems so that you can access objects correctly (#329)
Browse files Browse the repository at this point in the history
* fix json model problems so that you can access objects correctly

* use the project config to correctly get experiments
  • Loading branch information
thomaszurkan-optimizely authored Nov 6, 2018
1 parent 259ece0 commit c9211fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
7 changes: 6 additions & 1 deletion OptimizelyDemoApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

})
#endif
let variation = optimizelyClient?.activate((self?.experimentKey)!, userId: (self?.userId)!, attributes: (self?.attributes))
let variation = optimizelyClient?.activate((self?.experimentKey)!, userId: (self?.userId)!)

if let experiments = optimizelyClient?.optimizely?.config?.experiments {
for experiment in experiments {
print(experiment.experimentKey)
}
}
self?.setRootViewController(optimizelyClient: optimizelyClient, bucketedVariation:variation)
})

Expand Down
18 changes: 9 additions & 9 deletions OptimizelySDKCore/OptimizelySDKCore/OPTLYProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ NS_ASSUME_NONNULL_END
/// Flag for Bot Filtering
@property (nonatomic, strong, nonnull) NSNumber<OPTLYOptional> *botFiltering;
/// List of Optimizely Experiment objects
@property (nonatomic, strong, nonnull) NSArray<OPTLYExperiment> *experiments;
@property (nonatomic, strong, nonnull) NSArray<OPTLYExperiment*><OPTLYExperiment> *experiments;
/// List of Optimizely Event Type objects
@property (nonatomic, strong, nonnull) NSArray<OPTLYEvent> *events;
@property (nonatomic, strong, nonnull) NSArray<OPTLYEvent *><OPTLYEvent> *events;
/// List of audience ids
@property (nonatomic, strong, nonnull) NSArray<OPTLYAudience> *audiences;
@property (nonatomic, strong, nonnull) NSArray<OPTLYAudience *><OPTLYAudience> *audiences;
/// List of attributes objects
@property (nonatomic, strong, nonnull) NSArray<OPTLYAttribute> *attributes;
@property (nonatomic, strong, nonnull) NSArray<OPTLYAttribute*><OPTLYAttribute> *attributes;
/// List of group objects
@property (nonatomic, strong, nonnull) NSArray<OPTLYGroup> *groups;
@property (nonatomic, strong, nonnull) NSArray<OPTLYGroup*><OPTLYGroup> *groups;
/// List of live variable objects (DEPRECATED)
@property (nonatomic, strong, nonnull) NSArray<OPTLYVariable, OPTLYOptional> *variables;
@property (nonatomic, strong, nonnull) NSArray<OPTLYVariable *><OPTLYVariable, OPTLYOptional> *variables;

/// a comprehensive list of experiments that includes experiments being whitelisted (in Groups)
@property (nonatomic, strong, nullable) NSArray<OPTLYExperiment, Ignore> *allExperiments;
@property (nonatomic, strong, nullable) NSArray<OPTLYExperiment*><OPTLYExperiment, OPTLYOptional> *allExperiments;
@property (nonatomic, strong, nullable) id<OPTLYLogger, Ignore> logger;
@property (nonatomic, strong, nullable) id<OPTLYErrorHandler, Ignore> errorHandler;
@property (nonatomic, strong, readonly, nullable) id<OPTLYUserProfileService, Ignore> userProfileService;
Expand All @@ -72,9 +72,9 @@ NS_ASSUME_NONNULL_END
/// Returns the client version number
@property (nonatomic, strong, readonly, nonnull) NSString<Ignore> *clientVersion;
/// List of Optimizely Feature Flags objects
@property (nonatomic, strong, nonnull) NSArray<OPTLYFeatureFlag, OPTLYOptional> *featureFlags;
@property (nonatomic, strong, nonnull) NSArray<OPTLYFeatureFlag*><OPTLYFeatureFlag, OPTLYOptional> *featureFlags;
/// List of Optimizely Rollouts objects
@property (nonatomic, strong, nonnull) NSArray<OPTLYRollout, OPTLYOptional> *rollouts;
@property (nonatomic, strong, nonnull) NSArray<OPTLYRollout*><OPTLYRollout, OPTLYOptional> *rollouts;

/**
* Initialize the Project Config from a builder block.
Expand Down

0 comments on commit c9211fb

Please sign in to comment.