Skip to content

Commit 4e18023

Browse files
author
Николай Капустин
committed
Merge branch 'develop' into 'master'
update sharing url logic See merge request frontend/ios-sdk!4
2 parents 4c4aa85 + 70acbd5 commit 4e18023

7 files changed

Lines changed: 30 additions & 21 deletions

File tree

GPBonusSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = "GPBonusSDK"
3-
spec.version = ENV['LIB_VERSION'] || "2.0.1"
3+
spec.version = ENV['LIB_VERSION'] || "2.1.0"
44
spec.summary = "GazpromBonus widget integration lib"
55
spec.homepage = "https://github.com/SetPartnerstv/ios-sdk"
66
spec.license = { :type => "MIT", :file => "LICENSE" }

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ SPEC REPOS:
1111
SPEC CHECKSUMS:
1212
SwiftProtobuf: ed465ed18402f998fd117f631da27e0168e6b59c
1313

14-
PODFILE CHECKSUM: 83673be9a8bf482e1b93951c70e677a0e1acfb8e
14+
PODFILE CHECKSUM: b5f04a3e92c7b3b8274eae3bf26717ba045a7710
1515

16-
COCOAPODS: 1.12.1
16+
COCOAPODS: 1.16.2

sdk/SDKViewController.swift

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ open class SDKViewController: UIViewController, WKScriptMessageHandler, PaymentH
3535
let preferences = WKPreferences()
3636
preferences.javaScriptEnabled = true
3737
preferences.javaScriptCanOpenWindowsAutomatically = true
38-
39-
let bundle = Bundle(for: SDKViewController.self)
40-
let version = bundle.infoDictionary!["CFBundleShortVersionString"] as! String
41-
let build = bundle.infoDictionary!["CFBundleVersion"] as! String
42-
38+
39+
let version = "2.1.0"
40+
let build = "22"
41+
4342
let userScript = WKUserScript(
4443
source: """
4544
(function(){
4645
window.PNWidget = window.PNWidget || {};
4746
window.PNWidget._listeners = new Set();
48-
window.PNWidget.version = "\(version) (\(build))";
47+
window.PNWidget.version = "\(version)";
48+
window.PNWidget.build = "\(build)";
4949
window.PNWidget.platform = "iOS";
50-
window.PNWidget.features = { auth: false };
50+
window.PNWidget.features = { auth: false, share_text: true };
5151
5252
window.PNWidget.sendMobileEvent = function sendMobileEvent(event) {
5353
window.webkit.messageHandlers.PNWidget.postMessage(JSON.stringify(event));
@@ -307,10 +307,17 @@ open class SDKViewController: UIViewController, WKScriptMessageHandler, PaymentH
307307
}
308308

309309
private func shareURL(url: String) {
310-
if let link = URL(string: url.encodedURL) {
311-
let activityViewController = UIActivityViewController(activityItems: [link], applicationActivities: nil)
312-
activityViewController.excludedActivityTypes = [.airDrop, .mail]
313-
310+
var items:[Any] = [Any]()
311+
if let link = URL(string: url) {
312+
items.append(link)
313+
}
314+
else {
315+
items.append(url)
316+
}
317+
if items.count > 0 {
318+
let activityViewController = UIActivityViewController(activityItems: items, applicationActivities: nil)
319+
activityViewController.excludedActivityTypes = [.airDrop]
320+
314321
present(activityViewController, animated: true)
315322
}
316323
}

sdk/bld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

sdk/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.1.0

sdk_demo/GazpromBonusSDK.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
364364
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
365365
CODE_SIGN_STYLE = Automatic;
366-
CURRENT_PROJECT_VERSION = 2;
366+
CURRENT_PROJECT_VERSION = 22;
367367
DEVELOPMENT_TEAM = 3V7NW97R8C;
368368
FRAMEWORK_SEARCH_PATHS = (
369369
"$(inherited)",
@@ -385,7 +385,7 @@
385385
"$(inherited)",
386386
"@executable_path/Frameworks",
387387
);
388-
MARKETING_VERSION = 2.0.1;
388+
MARKETING_VERSION = 2.1.0;
389389
PRODUCT_BUNDLE_IDENTIFIER = ru.pnhub.partnerapplication;
390390
PRODUCT_NAME = "$(TARGET_NAME)";
391391
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -401,7 +401,7 @@
401401
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
402402
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
403403
CODE_SIGN_STYLE = Automatic;
404-
CURRENT_PROJECT_VERSION = 2;
404+
CURRENT_PROJECT_VERSION = 22;
405405
DEVELOPMENT_TEAM = 3V7NW97R8C;
406406
FRAMEWORK_SEARCH_PATHS = (
407407
"$(inherited)",
@@ -423,7 +423,7 @@
423423
"$(inherited)",
424424
"@executable_path/Frameworks",
425425
);
426-
MARKETING_VERSION = 2.0.1;
426+
MARKETING_VERSION = 2.1.0;
427427
PRODUCT_BUNDLE_IDENTIFIER = ru.pnhub.partnerapplication;
428428
PRODUCT_NAME = "$(TARGET_NAME)";
429429
SWIFT_EMIT_LOC_STRINGS = YES;

sdk_demo/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- GPBonusSDK (2.0.1):
2+
- GPBonusSDK (2.0.2):
33
- SwiftProtobuf (~> 1.14.0)
44
- SwiftProtobuf (1.14.0)
55

@@ -15,9 +15,9 @@ EXTERNAL SOURCES:
1515
:path: "../"
1616

1717
SPEC CHECKSUMS:
18-
GPBonusSDK: 056e491789c5c965a834cbd460c47205b7d5d7bd
18+
GPBonusSDK: 8ebdc32789a29a3e98724e683b655547f13b9fe0
1919
SwiftProtobuf: ed465ed18402f998fd117f631da27e0168e6b59c
2020

2121
PODFILE CHECKSUM: 3c73ac9aac1f862646b280aa7f07de7eace745dc
2222

23-
COCOAPODS: 1.12.1
23+
COCOAPODS: 1.16.2

0 commit comments

Comments
 (0)