Skip to content

Commit ad7ce9f

Browse files
authored
Dynamic framework (#412)
* Add Dynamic Framework • For historical reasons, OneSignal's iOS framework was a static framework, not a dynamic framework. • However, for some wrapper SDK's like Flutter, this causes issues with cocoapods. Any cocoapod in a project that uses use_frameworks! must not have any static dependencies • To fix this, we are considering adding a subspec to fix the problem, but will allow some of our users to test this branch in the mean time TODO: • We want this dynamic framework to run on iOS devices as well as run in the iOS simulator (x86_64 and i386 architectures) • To do this, we've made this a fat framework that contains slices for: arm64, armv7, x86_64, and i386 • However, Apple will not allow app submissions that contain fat frameworks • So we will soon need to create a build script developers can add to their apps that strips the simulator architecture slices from the framework, so developers don't run into this issue. • We will want to investigate if we can make this buildscript a part of our cocoapod target, or if it will require developers to add the script to their xcode projects. * Dynamic Fat Framework • It appears iOS framework codesigning fails if the framework uses symlinks and versions • Changed the build script so that the SDK will put all relevant directories in the root of the framework, instead of using symlinks at the root and a Versions/A folder • Created a new aggregate target that uses a buildscript to create a universal dynamic framework. • The new aggregate target uses a buildscript to generate two static libraries, one for simulator (x86_64 and i386) and one for real devices (arm64 and armv7), it then uses lipo to combine these into a single dynamic fat framework NOTE: The framework produced by the new dynamic target does not actually create its own product, it simply generates a new framework in the repo's /iOS_SDK/OneSignalSDK/Framework folder. * Add Additional Podspec for Dynamic Framework • We do not want to immediately switch all users to use our new fat dynamic framework • However we do want it to be available on Cocoapods, so we've created an additional podspec & framework path • When the project was started years back, the OneSignal-Dynamic target was actually creating a static framework, so I've renamed this target to OneSignal-Static-Framework • The new OneSignal-Dynamic-Framework is just an aggregate framework. It does not directly produce its own product. Instead it uses a build script to produce a dynamic framework at repo/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework
1 parent 997d20f commit ad7ce9f

File tree

15 files changed

+594
-78
lines changed

15 files changed

+594
-78
lines changed

OneSignal.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OneSignal"
3-
s.version = "2.8.7"
3+
s.version = "2.8.6"
44
s.summary = "OneSignal push notification library for mobile apps."
55
s.homepage = "https://onesignal.com"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

OneSignalDynamic.podspec

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Pod::Spec.new do |s|
2+
s.name = "OneSignalDynamic"
3+
s.version = "2.8.6"
4+
s.summary = "OneSignal push notification library for mobile apps."
5+
s.homepage = "https://onesignal.com"
6+
s.license = { :type => 'MIT', :file => 'LICENSE' }
7+
s.author = { "Joseph Kalash" => "[email protected]", "Josh Kasten" => "[email protected]" , "Brad Hesse" => "[email protected]"}
8+
9+
s.source = { :git => "https://github.com/OneSignal/OneSignal-iOS-SDK.git", :tag => s.version.to_s }
10+
11+
s.platform = :ios
12+
s.requires_arc = true
13+
14+
s.ios.vendored_frameworks = 'iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework'
15+
s.framework = 'SystemConfiguration', 'UIKit', 'UserNotifications'
16+
end
17+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
### OneSignal iOS SDK
6-
[![CocoaPods](https://img.shields.io/cocoapods/v/OneSignal.svg)](https://cocoapods.org/pods/OneSignal) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/OneSignal/OneSignal-iOS-SDK.svg?branch=master)](https://travis-ci.org/OneSignal/OneSignal-iOS-SDK)
6+
[![CocoaPods](https://img.shields.io/cocoapods/v/OneSignal.svg)](https://cocoapods.org/pods/OneSignal) [![CocoaPods](https://img.shields.io/cocoapods/dm/OneSignal.svg)](https://cocoapods.org/pods/OneSignal) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/OneSignal/OneSignal-iOS-SDK.svg?branch=master)](https://travis-ci.org/OneSignal/OneSignal-iOS-SDK)
77

88
---
99

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)