Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit 1edcd84

Browse files
Merge pull request #65 from applicaster-plugins/fix_ZNA_6690
fix: fixed ZNA-6690 https://asiatvusa.atlassian.net/browse/ZNA-6690 *…
2 parents 83415c8 + f7f50d9 commit 1edcd84

5 files changed

Lines changed: 106 additions & 21 deletions

File tree

Manifest/zapp_manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"dependency_repository_url": [
1313
"git@github.com:applicaster-plugins/Zee5PlayerPlugin-iOS.git"
1414
],
15-
"dependency_version": "1.1.45",
15+
"dependency_version": "1.1.46",
1616
"deprecated_since_zapp_sdk": "",
1717
"description": "Zee5 Player Plugin",
1818
"extra_dependencies": [],
1919
"identifier": "zee_player",
20-
"manifest_version": "1.1.45",
20+
"manifest_version": "1.1.46",
2121
"min_zapp_sdk": "14.1.8-RC",
2222
"name": "Zee5 Player Plugin",
2323
"npm_dependencies": [],

PluginClasses/ZEE5PlayerSDK/PlayerManager/ZEE5PlayerManager.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,7 +3178,7 @@ - (void)getSubscrptionList
31783178

31793179
-(void)playTrailer
31803180
{
3181-
_isNeedToSubscribe = true;
3181+
_isNeedToSubscribe = ZEE5PlayerSDK.getUserTypeEnum == Premium ? NO : YES;
31823182
if (_isLive == false && self.ModelValues.trailerIdentifier!=nil)
31833183
{
31843184
self.allowVideoContent = YES;
@@ -3198,7 +3198,10 @@ -(void)playTrailer
31983198
if (_ModelValues.isBeforeTv == true) {
31993199
[[Zee5PlayerPlugin sharedInstance]ConvivaErrorCode:1000 platformCode:@"006" severityCode:0 andErrorMsg:@"Before TV Popup -"];
32003200
}
3201-
[self HybridViewOpen];
3201+
3202+
if (_isNeedToSubscribe == YES) {
3203+
[self HybridViewOpen];
3204+
}
32023205
[self addCustomControls];
32033206

32043207
}

PluginClasses/ZEE5PlayerSDK/Utility/ZEE5UserDefaults.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,9 @@ + (void)setUserSubscribedPack:(NSString *)Pack
6868
}
6969
+ (NSString *)getSubscribedPack
7070
{
71-
id SubscribeDict =[[NSUserDefaults standardUserDefaults]valueForKey:@"SubscribePack"];
72-
if (SubscribeDict!=nil || [SubscribeDict isKindOfClass:[NSData class]])
73-
{
74-
return SubscribeDict;
75-
}
76-
return @"";
71+
NSString *subscriptions = [[[ZAAppConnector sharedInstance] storageDelegate] localStorageValueFor:@"user_subscriptions" namespace:@"zee5localstorage"];
72+
73+
return subscriptions != nil ? subscriptions : @"";
7774
}
7875
+ (void)setUserSettingData:(NSString *)UserSetting;
7976
{

PluginClasses/ZEE5PlayerSDK/ZEE5PlayerSDK.m

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,55 @@ +(ConnectionType)Getconnectiontype{
9494
}
9595

9696

97-
+ (Usertype)getUserTypeEnum{
98-
NSString *Usertype = [ZEE5UserDefaults getUserType];
99-
if ([Usertype isEqualToString:@"guest"]){
100-
usertype = Guest;
101-
}else if ([Usertype isEqualToString:@"registered"]){
102-
usertype = Registered;
103-
}else if ([Usertype isEqualToString:@"premium"]){
104-
usertype = Premium;
105-
}else{
106-
usertype = Guest;
97+
+ (Usertype)getUserTypeEnum {
98+
99+
Usertype value = Guest;
100+
101+
NSString
102+
*isLoggedInUserString = [[[ZAAppConnector sharedInstance] storageDelegate] localStorageValueFor:@"userLoginStatus" namespace:@"zee5localstorage"];
103+
BOOL isLoggedInUser = [ZEE5PlayerSDK getBoolValueFrom:isLoggedInUserString];
104+
if (isLoggedInUser == YES) {
105+
value = Registered;
106+
}
107+
108+
BOOL isSubscribed = NO;
109+
NSString *subscriptions = [ZEE5UserDefaults getSubscribedPack];
110+
NSMutableArray *subscriptionsArray = [[NSMutableArray alloc] init];
111+
NSData *subscriptionsData = [subscriptions dataUsingEncoding:NSUTF8StringEncoding];
112+
id _Nullable resultData = [NSJSONSerialization JSONObjectWithData:subscriptionsData options:0 error:nil];
113+
114+
for (NSDictionary *dict in resultData) {
115+
SubscriptionModel *model = [[SubscriptionModel alloc] initWithDictionary:dict];
116+
[subscriptionsArray addObject:model];
117+
}
118+
119+
NSMutableArray *activePlans = [[NSMutableArray alloc] init];
120+
for (SubscriptionModel *model in subscriptionsArray) {
121+
if ([model.state isEqualToString:@"activated"]) {
122+
[activePlans addObject:model];
123+
}
107124
}
108-
return usertype;
125+
126+
for (SubscriptionModel *model in activePlans) {
127+
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
128+
formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ssZ";
129+
NSString *subscriptionEndDate = model.subscriptionEnd != nil ? model.subscriptionEnd : @"";
130+
NSDate *date = [formatter dateFromString:subscriptionEndDate];
131+
NSInteger interval = [date timeIntervalSinceDate:[NSDate new]];
132+
if (interval > 0) {
133+
isSubscribed = YES;
134+
}
135+
}
136+
137+
if (isLoggedInUser == YES && isSubscribed == YES) {
138+
value = Premium;
139+
}
140+
return value;
141+
}
142+
143+
+ (BOOL)getBoolValueFrom:(NSString *)value {
144+
NSArray *trueValues = @[@"true", @"yes", @"1"];
145+
return [trueValues containsObject:[value lowercaseString]];
109146
}
110147

111148
+(ConsumptionType)getConsumpruionType{
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Pod::Spec.new do |s|
2+
s.name = "Zee5PlayerPlugin"
3+
s.version = '1.1.46'
4+
s.summary = "Zee5PlayerPlugin"
5+
s.description = <<-DESC
6+
Zee5PlayerPlugin.
7+
DESC
8+
s.homepage = "https://github.com/applicaster/Zee5PlayerPlugin-iOS"
9+
s.license = 'CMPS'
10+
s.author = "Applicaster LTD."
11+
s.source = { :git => "git@github.com:applicaster-plugins/Zee5PlayerPlugin-iOS.git", :tag => s.version.to_s }
12+
s.platform = :ios, '10.0'
13+
s.requires_arc = true
14+
s.ios.deployment_target = "10.0"
15+
s.swift_version = '5.1'
16+
s.libraries = 'z'
17+
18+
s.frameworks = 'UIKit','AVFoundation'
19+
s.source_files = 'PluginClasses/**/*.{h,m,swift,pch}'
20+
s.resources = [ 'PluginClasses/**/*.{xib,storyboard,png,ttf,xcassets,json}']
21+
22+
s.xcconfig = {
23+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
24+
'ENABLE_BITCODE' => 'YES',
25+
'SWIFT_VERSION' => '5.1',
26+
'OTHER_CFLAGS' => '-fembed-bitcode',
27+
'OTHER_LDFLAGS' => '-objc -ObjC -lc++ -framework "GoogleCast"',
28+
'GCC_SYMBOLS_PRIVATE_EXTERN' => 'YES'
29+
}
30+
31+
s.dependency 'ZappPlugins'
32+
s.dependency 'ApplicasterSDK'
33+
s.dependency 'ZappSDK'
34+
s.dependency 'PlayKit_IMA', '~> 1.8.0'
35+
s.dependency 'Protobuf'
36+
s.dependency 'google-cast-sdk-no-bluetooth', '= 4.4.7'
37+
s.dependency 'ConvivaSDK'
38+
s.dependency 'ComScore'
39+
s.dependency 'LotameDMP', '~> 5.0'
40+
s.dependency 'Zee5CoreSDK'
41+
s.dependency 'CarbonKit'
42+
s.dependency 'DropDown'
43+
s.dependency 'UICircularProgressRing'
44+
s.dependency 'SDWebImage'
45+
s.dependency 'DownloadToGo'
46+
s.dependency 'SQLite.swift'
47+
s.dependency 'ZeeHomeScreen'
48+
end

0 commit comments

Comments
 (0)