Compare commits
No commits in common. "main" and "3.40.7" have entirely different histories.
168
README.md
168
README.md
|
|
@ -9,6 +9,7 @@ This document describes how to integrate in your existing Xcode project the Tecn
|
|||
- [System requirements](#system)
|
||||
- [Installation](#installation)
|
||||
- [Swift Package Manager](#spm)
|
||||
- [Cocoapods](#cocoapods)
|
||||
- [Manual](#manual)
|
||||
- [Package contents](#contents)
|
||||
- [Changes to the Info.plist](#changes)
|
||||
|
|
@ -36,7 +37,7 @@ This document describes how to integrate in your existing Xcode project the Tecn
|
|||
|
||||
## Installation
|
||||
|
||||
If you are not using `Swift Package Manager` in your project, follow the instruction of the section [`'Manual'`](#manual)
|
||||
If you are not using Cocoapods in your project, follow the instruction of the section [`'Manual'`](#manual)
|
||||
|
||||
<a name="spm"></a>
|
||||
|
||||
|
|
@ -48,6 +49,58 @@ If you are not using `Swift Package Manager` in your project, follow the instruc
|
|||
4. Click `Add Package`.
|
||||
5. Go to `Project`-> `Build Settings`-> `Other Linker Flags` and add `-ObjC` if it's not already present.
|
||||
|
||||
<a name="cocoapods"></a>
|
||||
|
||||
### Cocoapods
|
||||
|
||||
#### Get the SDK via public repo
|
||||
|
||||
1. Add the following lines inside your target declaration in your `Podfile`.
|
||||
|
||||
Remember to add the source to our specs repo
|
||||
|
||||
```
|
||||
...
|
||||
source 'https://pubgit.newsmemory.com/tecnavia/newsmemory-ios-sdk-specs.git'
|
||||
...
|
||||
|
||||
target '<YOUR_TARGET>' do
|
||||
|
||||
...
|
||||
|
||||
pod 'NewsmemorySDK', '3.40.07'
|
||||
|
||||
...
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
2. If you are building locally, run `pod install`. If you upgrade from a previous version of NewsmemorySDK run `pod install --repo-update`
|
||||
|
||||
#### Get the SDK thru zip file
|
||||
|
||||
Tecnavia provides you a zip package named `ta-newsmemory-sdk_34007` (i.e. 34007, means that the SDK version is 3.40.07).
|
||||
|
||||
1. Unzip the package and copy the `ta-newsmemory-sdk_34007` folder in the folder containing your project's `Podfile` file.
|
||||
|
||||
2. Add the following lines inside your target declaration in your `Podfile`.
|
||||
|
||||
```
|
||||
...
|
||||
|
||||
target '<YOUR_TARGET>' do
|
||||
|
||||
...
|
||||
|
||||
pod 'NewsmemorySDK', path: 'ta-newsmemory-sdk_34007'
|
||||
|
||||
...
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
3. Run `pod install`.
|
||||
|
||||
<a name="manual"></a>
|
||||
|
||||
### Manual
|
||||
|
|
@ -127,6 +180,48 @@ The unzipped folder named `ta-newsmemory-sdk_34007` has the following subfolders
|
|||
|
||||
## Changes to the Info.plist
|
||||
|
||||
### Fonts (Cocoapods only)
|
||||
|
||||
If you are importing the ePaper SDK via Cocoapods, in order to make ePaper fonts available inside your app you'll need to add the font file name lines to your app's `Info.plist`.
|
||||
The key were to add the font names is `UIAppFonts`
|
||||
|
||||
```
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>Roboto_medium.ttf</string>
|
||||
<string>Roboto.ttf</string>
|
||||
<string>rubicon-icon-font.ttf</string>
|
||||
<string>Merriweather-Bold.otf</string>
|
||||
<string>Merriweather-Light.otf</string>
|
||||
<string>Merriweather-Regular.otf</string>
|
||||
<string>OpenSans-Bold.ttf</string>
|
||||
<string>OpenSans-Light.ttf</string>
|
||||
<string>OpenSans-Regular.ttf</string>
|
||||
<string>DroidKufi-Bold.ttf</string>
|
||||
<string>DroidKufi-Regular.ttf</string>
|
||||
<string>AntDesign.ttf</string>
|
||||
<string>Entypo.ttf</string>
|
||||
<string>EvilIcons.ttf</string>
|
||||
<string>Feather.ttf</string>
|
||||
<string>FontAwesome.ttf</string>
|
||||
<string>FontAwesome5_Brands.ttf</string>
|
||||
<string>FontAwesome5_Regular.ttf</string>
|
||||
<string>FontAwesome5_Solid.ttf</string>
|
||||
<string>Fontisto.ttf</string>
|
||||
<string>Foundation.ttf</string>
|
||||
<string>Ionicons.ttf</string>
|
||||
<string>MaterialCommunityIcons.ttf</string>
|
||||
<string>MaterialIcons.ttf</string>
|
||||
<string>Octicons.ttf</string>
|
||||
<string>SimpleLineIcons.ttf</string>
|
||||
<string>Zocial.ttf</string>
|
||||
<string>Nunito-Bold.ttf</string>
|
||||
<string>Nunito-Medium.ttf</string>
|
||||
<string>Nunito-Regular.ttf</string>
|
||||
<string>Nunito-Light.ttf</string>
|
||||
</array>
|
||||
```
|
||||
|
||||
### Other Info.plist values
|
||||
|
||||
The ePaper usually works with the key `UIViewControllerBasedStatusBarAppearance` set to `NO`
|
||||
|
|
@ -169,18 +264,13 @@ Tecnavia provides also the couple "PAPER_SETUP" - "SERVER" which allows you to l
|
|||
|
||||
Before displaying the ePaper View Controller (ex. during the your app setup), call the `Newsmemory` singleton to set the startup parameters.
|
||||
|
||||
1. Add the following import
|
||||
1. Import the following header file
|
||||
|
||||
```
|
||||
...
|
||||
@import Newsmemory;
|
||||
#import <Newsmemory/Newsmemory.h>
|
||||
...
|
||||
```
|
||||
or add the import of the `Newsmemory` framework in your `.swift` files
|
||||
|
||||
```
|
||||
import Newsmemory
|
||||
```
|
||||
|
||||
2. Make the class that will control the ePaper implement the `NewsmemoryDelegate` interface (the below code shows how you could do it in the `AppDelegate.h`).
|
||||
|
||||
|
|
@ -217,6 +307,49 @@ If you are using Storyboards you could simply create a `ViewController` element
|
|||
|
||||

|
||||
|
||||
## Swift integration
|
||||
|
||||
If you are using Swift in your app and you are using the `use_frameworks!` attribute you need to take additional steps:
|
||||
|
||||
1. add the following lines to your `Podfile`:
|
||||
|
||||
```
|
||||
...
|
||||
### PODS ###
|
||||
...
|
||||
|
||||
static_libraries = ['NewsmemorySDK'] # <- static libraries names
|
||||
# Make frameworks in the list static frameworks by overriding the static_framework?function to return true
|
||||
pre_install do |installer|
|
||||
installer.pod_targets.each do |pod|
|
||||
if static_libraries.include?(pod.name)
|
||||
puts "Overriding the static_framework? method for #{pod.name}"
|
||||
def pod.static_framework?;
|
||||
true
|
||||
end
|
||||
def pod.build_type;
|
||||
Pod::BuildType.static_library
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
```
|
||||
|
||||
2. run again `pod install`
|
||||
|
||||
3. Add to you project a `-Bridging-Header.h` file and add there the import of the `Newsmemory` module:
|
||||
|
||||
```
|
||||
#import <Newsmemory/Newsmemory.h>
|
||||
```
|
||||
|
||||
4. Remove the import of the `Newsmemory` module from your `.swift` files
|
||||
|
||||
~~import Newsmemory~~
|
||||
|
||||
5. Go to `Project`-> `Build Settings`-> `Objective-C Bridging Header` and add the path to the bridging header file. The path should be relative to your project, similar to the way your Info.plist path is specified in Build Settings (see https://developer.apple.com/documentation/swift/importing-objective-c-into-swift for more details).
|
||||
|
||||
## Dependencies
|
||||
|
||||
This SDK has been tested with `Google-Mobile-Ads-SDK` versions >= `9.6` and < `12`.
|
||||
|
|
@ -484,6 +617,25 @@ Ensure that the you imported the file `Newsmemory.js` within the SDK resources (
|
|||
This might mean that xCode is not including the required Swift packages.
|
||||
To fix simply add a blank .swift file and let xCode generate the corresponding bridging header.
|
||||
|
||||
#### - `CocoaPods could not find compatible versions for pod "NewsmemorySDK"` when running `pod install`
|
||||
|
||||
```
|
||||
[!] CocoaPods could not find compatible versions for pod "NewsmemorySDK":
|
||||
In Podfile:
|
||||
NewsmemorySDK (= 3.40.07)
|
||||
|
||||
None of your spec sources contain a spec satisfying the dependency: `NewsmemorySDK (= 3.40.07)`.
|
||||
|
||||
You have either:
|
||||
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
|
||||
* mistyped the name or version.
|
||||
* not added the source repo that hosts the Podspec to your Podfile.
|
||||
```
|
||||
|
||||
Simply run `pod install --repo-update`
|
||||
|
||||
---
|
||||
|
||||
<a name="authors"></a>
|
||||
|
||||
## Authors
|
||||
|
|
|
|||
Loading…
Reference in New Issue