Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rsmith/support swift #74

Merged
merged 26 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fe5c792
add SPM support
thib4ult Jan 26, 2024
a79516f
Update package to only build ios
rsmith-attentive Feb 2, 2024
9bf9513
changes to swift package
rsmith-attentive Feb 2, 2024
e77c1f2
Update build to only run ios
rsmith-attentive Feb 2, 2024
c28fd6c
Furthering specifying ios
rsmith-attentive Feb 2, 2024
0fa5c47
Add resiliency to building for diff platforms
rsmith-attentive Feb 2, 2024
48d69f9
Merge branch 'main' into rsmith/support-swift
rsmith-attentive Feb 2, 2024
906c998
removing more ununused versions of uikit
rsmith-attentive Feb 2, 2024
c6d0abe
remove pods
rsmith-attentive Feb 8, 2024
25807a5
update gitignore
rsmith-attentive Feb 8, 2024
a4c305c
Merge branch 'main' into rsmith/support-swift
rsmith-attentive Feb 8, 2024
1ecb502
update package name
rsmith-attentive Feb 13, 2024
407c7b3
Renaming package to be consistent with umbrella header
rsmith-attentive Feb 13, 2024
dff4951
Testing framework import path
rsmith-attentive Feb 13, 2024
e72768d
Updating other framework file
rsmith-attentive Feb 13, 2024
4bb4981
Reverting back to attentive-ios-sdk-framework
rsmith-attentive Feb 13, 2024
eb6b717
Renaming imports for framework to be exact paths
rsmith-attentive Feb 13, 2024
708b640
testing which framework file is used
rsmith-attentive Feb 13, 2024
c0de75f
Testing the reverse to see if both framework files work
rsmith-attentive Feb 13, 2024
0bf29e1
removing duplicate files and updating imports in the framework within…
rsmith-attentive Feb 13, 2024
cf0df4e
Swift is building
rsmith-attentive Feb 15, 2024
faea269
rename to SPM instead of Pod scheme
rsmith-attentive Feb 15, 2024
13007ab
lint and remove unnecessary changes
rsmith-attentive Feb 15, 2024
f1f69e6
Remove requirement for bridging header
rsmith-attentive Feb 15, 2024
f9fa19a
temp to switch contexts
rsmith-attentive Feb 20, 2024
fa56e43
Revert "temp to switch contexts"
rsmith-attentive Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SP5WN9647Z;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -606,7 +606,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SP5WN9647Z;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -667,7 +667,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SP5WN9647Z;
FRAMEWORK_SEARCH_PATHS = "";
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

141 changes: 59 additions & 82 deletions ExampleSwift/ExampleSwift.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "588EB71B2995BC3A00C0163A"
BuildableName = "ExampleSwift - SPM.app"
BlueprintName = "ExampleSwift - SPM"
ReferencedContainer = "container:ExampleSwift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "588EB71B2995BC3A00C0163A"
BuildableName = "ExampleSwift - SPM.app"
BlueprintName = "ExampleSwift - SPM"
ReferencedContainer = "container:ExampleSwift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "588EB71B2995BC3A00C0163A"
BuildableName = "ExampleSwift - SPM.app"
BlueprintName = "ExampleSwift - SPM"
ReferencedContainer = "container:ExampleSwift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 3 additions & 1 deletion ExampleSwift/ExampleSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
//

import Foundation
import UIKit
import ATTNSDKFramework

@main
class AppDelegate : UIResponder, UIApplicationDelegate {

var window: UIWindow?
public var attentiveSdk : ATTNSDK?
public var attentiveSdk : ATTNSDK?;

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

Expand Down
2 changes: 2 additions & 0 deletions ExampleSwift/ExampleSwift/ProductViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import Foundation
import os
import UIKit
import ATTNSDKFramework

class ProductViewController : UIViewController {
@IBOutlet var addToCartBtn : UIButton?
Expand Down
4 changes: 3 additions & 1 deletion ExampleSwift/ExampleSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import Foundation
import os
import UIKit
import ATTNSDKFramework

class ViewController : UIViewController {
@IBOutlet var creativeBtn : UIButton?
Expand All @@ -15,7 +17,7 @@ class ViewController : UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .systemGray3
self.view.backgroundColor = .white
}

@IBAction func creativeBtnPressed(sender: Any) {
Expand Down
23 changes: 0 additions & 23 deletions ExampleSwift/ExampleSwift/attentive-ios-sdk-bridging-header.h

This file was deleted.

This file was deleted.

16 changes: 16 additions & 0 deletions ExampleSwift/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "ATTNSDKFramework",
"repositoryURL": "https://github.com/attentive-mobile/attentive-ios-sdk",
"state": {
"branch": "rsmith/support-swift",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will adapt this to be main once this PR is merged

"revision": "0bf29e1001e180c0b84fe8e2bd350de7232a8346",
"version": null
}
}
]
},
"version": 1
}
25 changes: 25 additions & 0 deletions ExampleSwift/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "ExampleSwift",
platforms: [
.iOS(.v12)
],
products: [
.library(
name: "ExampleSwift",
targets: ["ExampleSwift"]),
],
dependencies: [
.package(url: "https://github.com/attentive-mobile/attentive-ios-sdk", .branch("rsmith/support-swift"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will adapt this to point to main once this PR is merged

],
targets: [
.target(
name: "ExampleSwift",
dependencies: [
.product(name: "ATTNSDKFramework", package: "attentive-ios-sdk")],
path: "ExampleSwift" // Ensure this path exists and is correct
),
]
)
10 changes: 0 additions & 10 deletions ExampleSwift/Podfile

This file was deleted.

16 changes: 0 additions & 16 deletions ExampleSwift/Podfile.lock

This file was deleted.

19 changes: 19 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ATTNSDKFramework",
platforms: [.iOS(.v12)],
products: [
.library(name: "ATTNSDKFramework", targets: ["ATTNSDKFramework"])

],
targets: [
.target(
name: "ATTNSDKFramework",
path: "Sources/"
)
]
)
1 change: 1 addition & 0 deletions Sources/ATTNSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

#import <WebKit/WebKit.h>
#import <UIKit/UIKit.h>
#import "ATTNAPI.h"
#import "ATTNSDK.h"
#import "ATTNUserIdentity.h"
Expand Down
14 changes: 12 additions & 2 deletions Sources/Internal/ATTNAppInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
//

#import <Foundation/Foundation.h>
#if TARGET_OS_IOS
#import <UIKit/UIKit.h>
#endif

#import "ATTNAppInfo.h"
#import "ATTNVersion.h"
Expand All @@ -27,11 +29,19 @@ + (NSString *)getAppId {
}

+ (NSString *)getDeviceModelName {
return [[UIDevice currentDevice] model];
#if TARGET_OS_IOS
return [[UIDevice currentDevice] model];
#else
return @"Not iOS device, not supported";
#endif
}

+ (NSString *)getDevicePlatform {
return [[UIDevice currentDevice] systemName];
#if TARGET_OS_IOS
return [[UIDevice currentDevice] systemName];
#else
return @"Not iOS device, not supported";
#endif
}

+ (NSString *)getDeviceOsVersion {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Internal/ATTNInfoEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef ATTNInfoEvent_h
#define ATTNInfoEvent_h

#import "ATTNEvent.h"
#import "../ATTNEvent.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down
18 changes: 18 additions & 0 deletions Sources/include/ATTNSDKFramework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import <Foundation/Foundation.h>

FOUNDATION_EXPORT double ATTNSDKFrameworkVersionNumber;

FOUNDATION_EXPORT const unsigned char ATTNSDKFrameworkVersionString[];

#import <../ATTNSDK.h>
#import <../ATTNUserIdentity.h>
#import <../ATTNEventTracker.h>
#import <../ATTNItem.h>
#import <../ATTNPrice.h>
#import <../ATTNEvent.h>
#import <../ATTNPurchaseEvent.h>
#import <../ATTNProductViewEvent.h>
#import <../ATTNAddToCartEvent.h>
#import <../ATTNOrder.h>
#import <../ATTNCart.h>
#import <../ATTNCustomEvent.h>
Loading
Loading