├── .gitignore
├── .jazzy.yaml
├── README.md
├── ShortLook-API.h
└── docs
├── Classes.html
├── Classes
├── DDNotificationContactPhotoPromise.html
├── DDNotificationContactPhotoPromiseOffer.html
├── DDNotificationContactPhotoSettings.html
└── DDUserNotification.html
├── Protocols.html
├── Protocols
└── DDNotificationContactPhotoProviding.html
├── badge.svg
├── css
├── highlight.css
└── jazzy.css
├── docsets
├── ShortLook API.docset
│ └── Contents
│ │ ├── Info.plist
│ │ └── Resources
│ │ ├── Documents
│ │ ├── Classes.html
│ │ ├── Classes
│ │ │ ├── DDNotificationContactPhotoPromise.html
│ │ │ ├── DDNotificationContactPhotoPromiseOffer.html
│ │ │ ├── DDNotificationContactPhotoSettings.html
│ │ │ └── DDUserNotification.html
│ │ ├── Protocols.html
│ │ ├── Protocols
│ │ │ └── DDNotificationContactPhotoProviding.html
│ │ ├── css
│ │ │ ├── highlight.css
│ │ │ └── jazzy.css
│ │ ├── img
│ │ │ ├── carat.png
│ │ │ ├── dash.png
│ │ │ ├── gh.png
│ │ │ └── spinner.gif
│ │ ├── index.html
│ │ ├── js
│ │ │ ├── jazzy.js
│ │ │ ├── jazzy.search.js
│ │ │ ├── jquery.min.js
│ │ │ ├── lunr.min.js
│ │ │ └── typeahead.jquery.js
│ │ └── search.json
│ │ └── docSet.dsidx
└── ShortLook API.tgz
├── img
├── carat.png
├── dash.png
├── gh.png
└── spinner.gif
├── index.html
├── js
├── jazzy.js
├── jazzy.search.js
├── jquery.min.js
├── lunr.min.js
└── typeahead.jquery.js
└── search.json
/.gitignore:
--------------------------------------------------------------------------------
1 | docs/undocumented.json
2 | .DS_Store
--------------------------------------------------------------------------------
/.jazzy.yaml:
--------------------------------------------------------------------------------
1 | module: ShortLook API
2 | module_version: 1.0.17
3 | author_url: https://dynastic.co/
4 | author: Dynastic Development
5 | github_url: https://github.com/dynastic/ShortLook-API
6 | github_file_prefix: https://github.com/dynastic/ShortLook-API/tree/master
7 | output: docs
8 | clean: true
9 | objc: true
10 | hide_declarations: swift
11 | umbrella_header: ShortLook-API.h
12 | theme: fullwidth
13 | framework_root: .
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ShortLook API Reference
2 |
3 | ## Table of Contents
4 |
5 | - [Contact Photo Provider](#contact-photo-provider)
6 | - [Always-on Screen State Provider](#always-on-screen-state-provider)
7 |
8 | ---
9 |
10 | # Contact Photo Provider
11 |
12 | Use the [ShortLook](https://dynastic.co/shortlook) API to create plugins that provide contact icons for third-party applications to ShortLook.
13 |
14 | - [Full Documentation](https://dynastic.github.io/ShortLook-API/)
15 | - [API header](/ShortLook-API.h)
16 | - [API template](https://www.github.com/dynastic/ShortLook-API-Template/)
17 |
18 | ## Quick Start
19 |
20 | 1. Setup your development environment just as you would to make tweaks, including Theos.
21 | 2. [Download the API template](https://www.github.com/dynastic/ShortLook-API-Template/archive/master.zip) and extract it's contents.
22 | 3. Rename your main class (DD_RENAMETHIS_ContactPhotoProvider).
23 | 4. Using the [Info.plist reference](#infoplist), change any values you may need to in `Info.plist`.
24 | 5. Implement your logic inside your main class's `contactPhotoPromiseOfferForNotification:` method ([details](#provider-classes)).
25 | 6. Configure your `Makefile` and `control` as you would a normal tweak, [using these tips](#metadata-tips).
26 |
27 | ## Photo Recommendations
28 |
29 | - Any format supported by iOS.
30 | - Around 1:1 in aspect ratio (or else it will be zoomed in).
31 | - Above `152x152px` in size (`@3x`, preferably).
32 |
33 | ## Provider Structure and Explanation
34 |
35 | Every provider plugin must have the following two things:
36 |
37 | - An `Info.plist` file describing how ShortLook should register the provider: [Documentation](#infoplist) [Example](https://www.github.com/dynastic/ShortLook-API-Template/blob/master/Info.plist).
38 | - An executable with (a) class(es) conforming to `DDNotificationContactPhotoProviding`: [Documentation](#provider-classes) [Example](https://www.github.com/dynastic/ShortLook-API-Template/blob/master/RENAMETHISContactPhotoProvider.m)
39 |
40 | ### Info.plist
41 |
42 | The `Info.plist` file specifies to ShortLook how it should load and handle this provider plugin internally. Every Info.plist file should have the following keys:
43 |
44 | - `CFBundleDisplayName`, **string**: A short name for what this plugin provides. In most cases, it should just be the name of the app you are providing for (e.g., Twitter).
45 | - `DDNotificationExternalProviderClasses` **dictionary**: A dictionary of provider classes, and the bundle identifiers they provide for. The key should represent your class name, and it's value may be either a **string** or **array of strings** containing the bundle identifiers of apps to provide for.
46 | - `DDNotificationExternalProviderAPIVersion` **integer**: *Must equal 1.* The ShortLook API version to use. This is to ensure that future updates with potentially breaking API changes do not crash ShortLook. These will be rare, if ever, but exists for future-proofing.
47 |
48 | If you'd like to see a working version, check out an [example of Info.plist here](https://www.github.com/dynastic/ShortLook-API-Template/blob/master/Info.plist).
49 |
50 | ### Provider classes
51 |
52 | Now that you've declared how ShortLook should load your plugin, you can start implementing the operations to receive contact photos.
53 |
54 | You will make a class that inherits from `NSObject` and conforms to `DDNotificationContactPhotoProviding`. You should import `ShortLook-API.h` in your project for ease of use.
55 |
56 | Each provider class implements the following method:
57 |
58 | ```objc
59 | /// Returns an offer to fulfill a promise to provide a contact photo for a notification.
60 | - (DDNotificationContactPhotoPromiseOffer *)contactPhotoPromiseOfferForNotification:(DDUserNotification *)notification;
61 | ```
62 |
63 | If you'd like to see a working version, check out an [example of a provider class here](https://www.github.com/dynastic/ShortLook-API-Template/blob/master/RENAMETHISContactPhotoProvider.m).
64 |
65 | > **Heads up!** Make sure your provider's class is unique (rename it if you used an example). In Objective-C, there may only have one class for a name. If any other classes exist with that name, your provider will crash the system.
66 |
67 | #### Promises and Offers
68 |
69 | When ShortLook asks you for a photo, you first return an object called an *Offer* (if you don't want to provide for a notification, return `nil`). This offer is simple: you provide the photo identifier, and then set a block that will be called if ShortLook needs your provider. A parameter on this block you set is an object called a *Promise*. While this promise doesn't directly contain your image at first, it eventually will be used to contain one by your provider. It is, in most basic terms, a *promise* to provide a contact photo. Since most provider's images will take a while to get (network requests, etc.), this is necessary to ensure optimal performance.
70 |
71 | You initialize your offer with a **photo identifier**, which is a unique string for the contact photo you will provide, for internal use by ShortLook (such as caching, or choosing when to display the image). For the system contact photo provider, this identifier is the phone number or email address of the notification. For a provider like Twitter, it is the URL of the profile photo. For another social network, you may opt to use the photo's account's screen name, it that's more appropriate. Whatever your identifier be, just ensure it represents the photo you will return uniquely.
72 |
73 | Once you have initialized your offer object, you can add a resolver using `fulfillWithBlock:`. The block you provide here should contain every next operation for grabbing the contact photo, such as network requests. Once you have received your image, pass it back to ShortLook by calling `resolveWithImage:` on your promise, which is a parameter of your block. If an error occurs and you are not able to fetch a contact photo for the user, call `reject` on the promise. Once you've resolved or rejected a promise, you may not do so it again, such as to change the image.
74 |
75 | The promise object also features many properties, such as `usesCaching` and `backgroundColor`, which can be set at any time before the promise is completed.
76 |
77 | ##### What if I can get my image instantly?
78 |
79 | If your image is returned instantly, rather than by using a network request, you can use a convenience method on `DDNotificationContactPhotoPromiseOffer`, named `offerInstantlyResolvingPromiseWithPhotoIdentifier:image:`. Just return the generated promise from your provider. Choose wisely, though. This method should only be used if you can get your image absolutely instantly. If you take too long using this synchronous method, ShortLook may penalize your provider.
80 |
81 | ## Metadata Tips
82 |
83 | - Your package should usually be called something like "APP Photo Provider for ShortLook" in Cydia.
84 | - It is recommended you make your bundle name something like "ShortLook-APP".
85 |
86 | ## Full Documentation
87 |
88 | You can view the full class documentation for ShortLook's photo provider API [here](https://dynastic.github.io/ShortLook-API/).
89 |
90 | ## Examples
91 |
92 | You can look at the following open source provider examples to get an idea of how to use the ShortLook API:
93 |
94 | - [Blank Template](https://www.github.com/dynastic/ShortLook-API-Template/)
95 | - [Twitter](https://www.github.com/dynastic/ShortLook-Twitter/)
96 |
97 | ---
98 |
99 | # Always-on Screen State Provider
100 |
101 | Starting in version 1.0.2, ShortLook provides an external coordination API for non-Dynastic tweaks to use. It will allow these tweaks to provide the screen’s display on state, since some tweaks fake the screen being off on OLED phones.
102 |
103 | If your tweak keeps the screen on while the user would expect it to be off, ShortLook can obey this preference and behave like the screen is off.
104 |
105 | First, implement the following provider in a class where you wish to provide this information:
106 |
107 | ```objc
108 | @protocol DDLunarScreenStateProvider
109 | @required
110 | /// If your tweak keeps the screen awake to provide an always-on experience but should act to Lunar like the display is off, return whether you want the screen to be treated as on or off here. If any single provider is returning NO for this, the screen will be treated as such.
111 | - (BOOL)isScreenOn;
112 | @end
113 | ```
114 |
115 | Once you have implemented that, you must register an instance of this class using `DDLunarScreenStateManager`. You can call `registerScreenStateProvider:` on the shared manager to tell ShortLook to ask your provider before deciding how to treat the screen state, using the following header:
116 |
117 | ```objc
118 | @interface DDLunarScreenStateManager: NSObject
119 | + (instancetype)sharedManager;
120 | - (void)registerScreenStateProvider:(NSObject *)provider;
121 | - (void)deregisterScreenStateProvider:(NSObject *)provider;
122 | @end
123 | ```
124 |
125 | **Do not check for the presence of ShortLook by checking the filesystem or other classes.** You can directly check that `DDLunarScreenStateManager` exists. ShortLook will hold a strong reference to your screen state provider until it is deregistered.
126 |
127 | ```objc
128 | if (NSClassFromString(@"DDLunarScreenStateManager")) {
129 | MyScreenStateProvider *provider = [MyScreenStateProvider new];
130 | [[%c(DDLunarScreenStateManager) sharedManager] registerScreenStateProvider:provider];
131 | }
132 | ```
133 |
--------------------------------------------------------------------------------
/ShortLook-API.h:
--------------------------------------------------------------------------------
1 | //
2 | // WARNING:
3 | // This file contains the required headers to compile a tweak that
4 | // interacts with ShortLook's contact photo API. Do not modify the
5 | // headers within, or it could lead to unexpected behaviour.
6 | //
7 | // ---
8 | //
9 | // ShortLook-API.h
10 | //
11 | // Created by AppleBetas on 2018-05-18.
12 | // Copyright © 2018 Dynastic Development. All rights reserved.
13 | //
14 |
15 | #import
16 | @class NCNotificationRequest, UNNotificationContent;
17 |
18 | /// A ShortLook-displayable notification representing a real user notification sent by an application to the system.
19 | @interface DDUserNotification : NSObject
20 | /// A custom notification title, separate from the application's title.
21 | @property (nonatomic, retain, readonly) NSString *notificationTitle;
22 |
23 | /// A dictionary of any extra information included by ShortLook.
24 | @property (nonatomic, retain) NSDictionary *userInfo;
25 |
26 | /// The system notification request that created this notification.
27 | @property (nonatomic, readonly, retain) NCNotificationRequest *request;
28 |
29 | /// The user notification's content, sent by the application.
30 | - (UNNotificationContent *)content;
31 |
32 | /// A dictionary of any extra information provided by the application sending the notification.
33 | - (NSDictionary *)applicationUserInfo;
34 |
35 | /// The bundle identifier of the application this notification represents.
36 | - (NSString *)senderIdentifier;
37 | @end
38 |
39 | /// An object representing settings for the photo to be provided by a promise.
40 | @interface DDNotificationContactPhotoSettings: NSObject
41 | /// The background colour to show for the contact photo view if the provided image contains any transparency.
42 | @property (nonatomic, retain) UIColor *backgroundColor;
43 |
44 | /// Whether or not ShortLook should automatically cache the returned image from your provider and use it for all future notifications with the same photo identifier and application.
45 | @property (nonatomic, assign) BOOL usesCaching;
46 | @end
47 |
48 | /// A promise representing a commitment to providing a contact icon for a notification.
49 | @interface DDNotificationContactPhotoPromise: NSObject
50 | /// An object holding the settings pertaining to the photo to be displayed.
51 | @property (nonatomic, retain) DDNotificationContactPhotoSettings *settings;
52 |
53 | /// Whether or not this promise has already been resolved or rejected.
54 | @property (nonatomic, readonly, assign) BOOL isComplete;
55 |
56 | // MARK: - Provider methods
57 |
58 | /// Resolve this promise with the provided image, notifying ShortLook that you have received your image.
59 | /// - NOTE: This method should only be ran from within `addResolver:`.
60 | - (void)resolveWithImage:(UIImage *)image;
61 |
62 | /// Reject this promise, notifying ShortLook that you failed to receive an image.
63 | /// - NOTE: This method should only be ran from within `addResolver:`.
64 | - (void)reject;
65 | @end
66 |
67 | /// An offer to fulfill a promise representing a commitment to providing a contact icon for a notification.
68 | @interface DDNotificationContactPhotoPromiseOffer: NSObject
69 | /// A unique identifier for the photo that will be provided by this promise.
70 | @property (nonatomic, readonly, retain) NSString *photoIdentifier;
71 |
72 | /// A string to replace the notification's title with, if it is required for your provider's context. Set to "" to remove the provided notification's title.
73 | @property (nonatomic, retain) NSString *titleOverride;
74 |
75 | /// A string to replace the notification's subtitle with, if it is required for your provider's context. Set to "" to remove the provided notification's subtitle.
76 | @property (nonatomic, retain) NSString *subtitleOverride;
77 |
78 | /// A string to replace the notification's body with, if it is required for your provider's context. Set to "" to remove the provided notification's body.
79 | @property (nonatomic, retain) NSString *bodyOverride;
80 |
81 | /// Initialize a promise with the provided photo identifier.
82 | - (instancetype)initWithPhotoIdentifier:(NSString *)photoIdentifier;
83 |
84 | /// Create a promise offer that will return the image at the provided URL, if needed.
85 | + (instancetype)offerDownloadingPromiseWithPhotoIdentifier:(NSString *)photoIdentifier fromURL:(NSURL *)url;
86 |
87 | /// Create a promise offer that will return the image at the provided URL, if needed, with custom settings.
88 | + (instancetype)offerDownloadingPromiseWithPhotoIdentifier:(NSString *)photoIdentifier fromURL:(NSURL *)url withSettings:(DDNotificationContactPhotoSettings *)settings;
89 |
90 | /// Create a promise offer that will instantly return the provided image.
91 | + (instancetype)offerInstantlyResolvingPromiseWithPhotoIdentifier:(NSString *)photoIdentifier image:(UIImage *)image;
92 |
93 | /// Create a promise offer that will instantly return the provided image with custom settings.
94 | + (instancetype)offerInstantlyResolvingPromiseWithPhotoIdentifier:(NSString *)photoIdentifier image:(UIImage *)image withSettings:(DDNotificationContactPhotoSettings *)settings;
95 |
96 | /// Add the block that will run if your image is needed (as it will not be in some cases, such as if your image is already cached by ShortLook).
97 | /// If your provider does any long-running or asynchronous operations, they should be done using this method.
98 | /// Any code run inside the provider block will be performed on a background thread.
99 | - (void)fulfillWithBlock:(void (^)(DDNotificationContactPhotoPromise *promise))block;
100 | @end
101 |
102 | /// An object that can provide contact photos for ShortLook notifications.
103 | @protocol DDNotificationContactPhotoProviding
104 | @required
105 | /// Returns an offer to fulfill a promise to provide a contact photo for a notification.
106 | - (DDNotificationContactPhotoPromiseOffer *)contactPhotoPromiseOfferForNotification:(DDUserNotification *)notification;
107 | @end
108 |
--------------------------------------------------------------------------------
/docs/Classes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Classes Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
34 |
35 |
41 |
42 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | Classes Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
Classes
85 |
The following classes are available globally.
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
102 |
103 |
104 |
105 |
106 |
107 |
A ShortLook-displayable notification representing a real user notification sent by an application to the system.
108 |
109 |
See more
110 |
111 |
112 |
Declaration
113 |
114 |
Objective-C
115 |
@interface DDUserNotification
116 |
117 |
118 |
119 |
122 |
123 |
124 |
125 |
126 |
133 |
134 |
135 |
136 |
137 |
138 |
An object representing settings for the photo to be provided by a promise.
139 |
140 |
See more
141 |
142 |
143 |
Declaration
144 |
145 |
Objective-C
146 |
@interface DDNotificationContactPhotoSettings
147 |
148 |
149 |
150 |
153 |
154 |
155 |
156 |
157 |
164 |
165 |
166 |
167 |
168 |
169 |
A promise representing a commitment to providing a contact icon for a notification.
170 |
171 |
See more
172 |
173 |
174 |
Declaration
175 |
176 |
Objective-C
177 |
@interface DDNotificationContactPhotoPromise
178 |
179 |
180 |
181 |
184 |
185 |
186 |
187 |
188 |
195 |
196 |
197 |
198 |
199 |
200 |
An offer to fulfill a promise representing a commitment to providing a contact icon for a notification.
201 |
202 |
See more
203 |
204 |
205 |
Declaration
206 |
207 |
Objective-C
208 |
@interface DDNotificationContactPhotoPromiseOffer
209 |
210 |
211 |
212 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
229 |
230 |
231 |
232 |
--------------------------------------------------------------------------------
/docs/Classes/DDNotificationContactPhotoPromise.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDNotificationContactPhotoPromise Class Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDNotificationContactPhotoPromise Class Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDNotificationContactPhotoPromise
85 |
86 |
87 |
@interface DDNotificationContactPhotoPromise
88 |
89 |
90 |
91 |
A promise representing a commitment to providing a contact icon for a notification.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | settings
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
An object holding the settings pertaining to the photo to be displayed.
114 |
115 |
116 |
117 |
Declaration
118 |
124 |
125 |
128 |
129 |
130 |
131 |
132 |
139 |
140 |
141 |
142 |
143 |
144 |
Whether or not this promise has already been resolved or rejected.
145 |
146 |
147 |
148 |
Declaration
149 |
150 |
Objective-C
151 |
@property ( nonatomic , assign , unsafe_unretained , readonly ) int isComplete ;
152 |
153 |
154 |
155 |
158 |
159 |
160 |
161 |
162 |
169 |
170 |
171 |
172 |
173 |
174 |
Resolve this promise with the provided image, notifying ShortLook that you have received your image.
175 |
176 |
Note
177 | This method should only be ran from within
addResolver:
.
178 |
179 |
180 |
181 |
182 |
183 |
Declaration
184 |
185 |
Objective-C
186 |
- ( void ) resolveWithImage :( id ) image ;
187 |
188 |
189 |
190 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 | -reject
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
Reject this promise, notifying ShortLook that you failed to receive an image.
210 |
211 |
Note
212 | This method should only be ran from within
addResolver:
.
213 |
214 |
215 |
216 |
217 |
218 |
Declaration
219 |
220 |
Objective-C
221 |
- ( void ) reject ;
222 |
223 |
224 |
225 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
242 |
243 |
244 |
245 |
--------------------------------------------------------------------------------
/docs/Classes/DDNotificationContactPhotoSettings.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDNotificationContactPhotoSettings Class Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDNotificationContactPhotoSettings Class Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDNotificationContactPhotoSettings
85 |
86 |
87 |
@interface DDNotificationContactPhotoSettings
88 |
89 |
90 |
91 |
An object representing settings for the photo to be provided by a promise.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
108 |
109 |
110 |
111 |
112 |
113 |
The background colour to show for the contact photo view if the provided image contains any transparency.
114 |
115 |
116 |
117 |
Declaration
118 |
119 |
Objective-C
120 |
@property ( nonatomic , retain ) UIColor * backgroundColor
121 |
122 |
123 |
124 |
127 |
128 |
129 |
130 |
131 |
138 |
139 |
140 |
141 |
142 |
143 |
Whether or not ShortLook should automatically cache the returned image from your provider and use it for all future notifications with the same photo identifier and application.
144 |
145 |
146 |
147 |
Declaration
148 |
149 |
Objective-C
150 |
@property ( nonatomic , assign , unsafe_unretained , readwrite ) int usesCaching ;
151 |
152 |
153 |
154 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
171 |
172 |
173 |
174 |
--------------------------------------------------------------------------------
/docs/Classes/DDUserNotification.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDUserNotification Class Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDUserNotification Class Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDUserNotification
85 |
86 |
87 |
@interface DDUserNotification
88 |
89 |
90 |
91 |
A ShortLook-displayable notification representing a real user notification sent by an application to the system.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
108 |
109 |
110 |
111 |
112 |
113 |
A custom notification title, separate from the application’s title.
114 |
115 |
116 |
117 |
Declaration
118 |
119 |
Objective-C
120 |
@property ( nonatomic , retain , readonly ) NSString * notificationTitle
121 |
122 |
123 |
124 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | userInfo
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
A dictionary of any extra information included by ShortLook.
144 |
145 |
146 |
147 |
Declaration
148 |
149 |
Objective-C
150 |
@property ( nonatomic , retain ) NSDictionary * userInfo
151 |
152 |
153 |
154 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 | request
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
The system notification request that created this notification.
174 |
175 |
176 |
177 |
Declaration
178 |
179 |
Objective-C
180 |
@property ( nonatomic , retain , readonly ) NCNotificationRequest * request ;
181 |
182 |
183 |
184 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 | -content
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
The user notification’s content, sent by the application.
204 |
205 |
206 |
207 |
Declaration
208 |
209 |
Objective-C
210 |
- ( UNNotificationContent * ) content ;
211 |
212 |
213 |
214 |
217 |
218 |
219 |
220 |
221 |
228 |
229 |
230 |
231 |
232 |
233 |
A dictionary of any extra information provided by the application sending the notification.
234 |
235 |
236 |
237 |
Declaration
238 |
239 |
Objective-C
240 |
- ( id ) applicationUserInfo ;
241 |
242 |
243 |
244 |
247 |
248 |
249 |
250 |
251 |
258 |
259 |
260 |
261 |
262 |
263 |
The bundle identifier of the application this notification represents.
264 |
265 |
266 |
267 |
Declaration
268 |
269 |
Objective-C
270 |
- ( id ) senderIdentifier ;
271 |
272 |
273 |
274 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
291 |
292 |
293 |
294 |
--------------------------------------------------------------------------------
/docs/Protocols.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Protocols Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | Protocols Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
Protocols
85 |
The following protocols are available globally.
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
102 |
103 |
104 |
105 |
106 |
107 |
An object that can provide contact photos for ShortLook notifications.
108 |
109 |
See more
110 |
111 |
112 |
Declaration
113 |
114 |
Objective-C
115 |
@protocol DDNotificationContactPhotoProviding
116 |
117 |
118 |
119 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/docs/Protocols/DDNotificationContactPhotoProviding.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDNotificationContactPhotoProviding Protocol Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDNotificationContactPhotoProviding Protocol Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDNotificationContactPhotoProviding
85 |
86 |
87 |
@protocol DDNotificationContactPhotoProviding
88 |
89 |
90 |
91 |
An object that can provide contact photos for ShortLook notifications.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
108 |
109 |
110 |
111 |
112 |
113 |
Returns an offer to fulfill a promise to provide a contact photo for a notification.
114 |
115 |
116 |
117 |
Declaration
118 |
124 |
125 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/docs/badge.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | documentation
17 |
18 |
19 | documentation
20 |
21 |
22 | 100%
23 |
24 |
25 | 100%
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/css/highlight.css:
--------------------------------------------------------------------------------
1 | /* Credit to https://gist.github.com/wataru420/2048287 */
2 | .highlight {
3 | /* Comment */
4 | /* Error */
5 | /* Keyword */
6 | /* Operator */
7 | /* Comment.Multiline */
8 | /* Comment.Preproc */
9 | /* Comment.Single */
10 | /* Comment.Special */
11 | /* Generic.Deleted */
12 | /* Generic.Deleted.Specific */
13 | /* Generic.Emph */
14 | /* Generic.Error */
15 | /* Generic.Heading */
16 | /* Generic.Inserted */
17 | /* Generic.Inserted.Specific */
18 | /* Generic.Output */
19 | /* Generic.Prompt */
20 | /* Generic.Strong */
21 | /* Generic.Subheading */
22 | /* Generic.Traceback */
23 | /* Keyword.Constant */
24 | /* Keyword.Declaration */
25 | /* Keyword.Pseudo */
26 | /* Keyword.Reserved */
27 | /* Keyword.Type */
28 | /* Literal.Number */
29 | /* Literal.String */
30 | /* Name.Attribute */
31 | /* Name.Builtin */
32 | /* Name.Class */
33 | /* Name.Constant */
34 | /* Name.Entity */
35 | /* Name.Exception */
36 | /* Name.Function */
37 | /* Name.Namespace */
38 | /* Name.Tag */
39 | /* Name.Variable */
40 | /* Operator.Word */
41 | /* Text.Whitespace */
42 | /* Literal.Number.Float */
43 | /* Literal.Number.Hex */
44 | /* Literal.Number.Integer */
45 | /* Literal.Number.Oct */
46 | /* Literal.String.Backtick */
47 | /* Literal.String.Char */
48 | /* Literal.String.Doc */
49 | /* Literal.String.Double */
50 | /* Literal.String.Escape */
51 | /* Literal.String.Heredoc */
52 | /* Literal.String.Interpol */
53 | /* Literal.String.Other */
54 | /* Literal.String.Regex */
55 | /* Literal.String.Single */
56 | /* Literal.String.Symbol */
57 | /* Name.Builtin.Pseudo */
58 | /* Name.Variable.Class */
59 | /* Name.Variable.Global */
60 | /* Name.Variable.Instance */
61 | /* Literal.Number.Integer.Long */ }
62 | .highlight .c {
63 | color: #999988;
64 | font-style: italic; }
65 | .highlight .err {
66 | color: #a61717;
67 | background-color: #e3d2d2; }
68 | .highlight .k {
69 | color: #000000;
70 | font-weight: bold; }
71 | .highlight .o {
72 | color: #000000;
73 | font-weight: bold; }
74 | .highlight .cm {
75 | color: #999988;
76 | font-style: italic; }
77 | .highlight .cp {
78 | color: #999999;
79 | font-weight: bold; }
80 | .highlight .c1 {
81 | color: #999988;
82 | font-style: italic; }
83 | .highlight .cs {
84 | color: #999999;
85 | font-weight: bold;
86 | font-style: italic; }
87 | .highlight .gd {
88 | color: #000000;
89 | background-color: #ffdddd; }
90 | .highlight .gd .x {
91 | color: #000000;
92 | background-color: #ffaaaa; }
93 | .highlight .ge {
94 | color: #000000;
95 | font-style: italic; }
96 | .highlight .gr {
97 | color: #aa0000; }
98 | .highlight .gh {
99 | color: #999999; }
100 | .highlight .gi {
101 | color: #000000;
102 | background-color: #ddffdd; }
103 | .highlight .gi .x {
104 | color: #000000;
105 | background-color: #aaffaa; }
106 | .highlight .go {
107 | color: #888888; }
108 | .highlight .gp {
109 | color: #555555; }
110 | .highlight .gs {
111 | font-weight: bold; }
112 | .highlight .gu {
113 | color: #aaaaaa; }
114 | .highlight .gt {
115 | color: #aa0000; }
116 | .highlight .kc {
117 | color: #000000;
118 | font-weight: bold; }
119 | .highlight .kd {
120 | color: #000000;
121 | font-weight: bold; }
122 | .highlight .kp {
123 | color: #000000;
124 | font-weight: bold; }
125 | .highlight .kr {
126 | color: #000000;
127 | font-weight: bold; }
128 | .highlight .kt {
129 | color: #445588; }
130 | .highlight .m {
131 | color: #009999; }
132 | .highlight .s {
133 | color: #d14; }
134 | .highlight .na {
135 | color: #008080; }
136 | .highlight .nb {
137 | color: #0086B3; }
138 | .highlight .nc {
139 | color: #445588;
140 | font-weight: bold; }
141 | .highlight .no {
142 | color: #008080; }
143 | .highlight .ni {
144 | color: #800080; }
145 | .highlight .ne {
146 | color: #990000;
147 | font-weight: bold; }
148 | .highlight .nf {
149 | color: #990000; }
150 | .highlight .nn {
151 | color: #555555; }
152 | .highlight .nt {
153 | color: #000080; }
154 | .highlight .nv {
155 | color: #008080; }
156 | .highlight .ow {
157 | color: #000000;
158 | font-weight: bold; }
159 | .highlight .w {
160 | color: #bbbbbb; }
161 | .highlight .mf {
162 | color: #009999; }
163 | .highlight .mh {
164 | color: #009999; }
165 | .highlight .mi {
166 | color: #009999; }
167 | .highlight .mo {
168 | color: #009999; }
169 | .highlight .sb {
170 | color: #d14; }
171 | .highlight .sc {
172 | color: #d14; }
173 | .highlight .sd {
174 | color: #d14; }
175 | .highlight .s2 {
176 | color: #d14; }
177 | .highlight .se {
178 | color: #d14; }
179 | .highlight .sh {
180 | color: #d14; }
181 | .highlight .si {
182 | color: #d14; }
183 | .highlight .sx {
184 | color: #d14; }
185 | .highlight .sr {
186 | color: #009926; }
187 | .highlight .s1 {
188 | color: #d14; }
189 | .highlight .ss {
190 | color: #990073; }
191 | .highlight .bp {
192 | color: #999999; }
193 | .highlight .vc {
194 | color: #008080; }
195 | .highlight .vg {
196 | color: #008080; }
197 | .highlight .vi {
198 | color: #008080; }
199 | .highlight .il {
200 | color: #009999; }
201 |
--------------------------------------------------------------------------------
/docs/css/jazzy.css:
--------------------------------------------------------------------------------
1 | *, *:before, *:after {
2 | box-sizing: inherit; }
3 |
4 | body {
5 | margin: 0;
6 | background: #fff;
7 | color: #333;
8 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
9 | letter-spacing: .2px;
10 | -webkit-font-smoothing: antialiased;
11 | box-sizing: border-box; }
12 |
13 | h1 {
14 | font-size: 2rem;
15 | font-weight: 700;
16 | margin: 1.275em 0 0.6em; }
17 |
18 | h2 {
19 | font-size: 1.75rem;
20 | font-weight: 700;
21 | margin: 1.275em 0 0.3em; }
22 |
23 | h3 {
24 | font-size: 1.5rem;
25 | font-weight: 700;
26 | margin: 1em 0 0.3em; }
27 |
28 | h4 {
29 | font-size: 1.25rem;
30 | font-weight: 700;
31 | margin: 1.275em 0 0.85em; }
32 |
33 | h5 {
34 | font-size: 1rem;
35 | font-weight: 700;
36 | margin: 1.275em 0 0.85em; }
37 |
38 | h6 {
39 | font-size: 1rem;
40 | font-weight: 700;
41 | margin: 1.275em 0 0.85em;
42 | color: #777; }
43 |
44 | p {
45 | margin: 0 0 1em; }
46 |
47 | ul, ol {
48 | padding: 0 0 0 2em;
49 | margin: 0 0 0.85em; }
50 |
51 | blockquote {
52 | margin: 0 0 0.85em;
53 | padding: 0 15px;
54 | color: #858585;
55 | border-left: 4px solid #e5e5e5; }
56 |
57 | img {
58 | max-width: 100%; }
59 |
60 | a {
61 | color: #4183c4;
62 | text-decoration: none; }
63 | a:hover, a:focus {
64 | outline: 0;
65 | text-decoration: underline; }
66 | a.discouraged {
67 | text-decoration: line-through; }
68 | a.discouraged:hover, a.discouraged:focus {
69 | text-decoration: underline line-through; }
70 |
71 | table {
72 | background: #fff;
73 | width: 100%;
74 | border-collapse: collapse;
75 | border-spacing: 0;
76 | overflow: auto;
77 | margin: 0 0 0.85em; }
78 |
79 | tr:nth-child(2n) {
80 | background-color: #fbfbfb; }
81 |
82 | th, td {
83 | padding: 6px 13px;
84 | border: 1px solid #ddd; }
85 |
86 | pre {
87 | margin: 0 0 1.275em;
88 | padding: .85em 1em;
89 | overflow: auto;
90 | background: #f7f7f7;
91 | font-size: .85em;
92 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
93 |
94 | code {
95 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
96 |
97 | p > code, li > code {
98 | background: #f7f7f7;
99 | padding: .2em; }
100 | p > code:before, p > code:after, li > code:before, li > code:after {
101 | letter-spacing: -.2em;
102 | content: "\00a0"; }
103 |
104 | pre code {
105 | padding: 0;
106 | white-space: pre; }
107 |
108 | .content-wrapper {
109 | display: flex;
110 | flex-direction: column; }
111 | @media (min-width: 768px) {
112 | .content-wrapper {
113 | flex-direction: row; } }
114 |
115 | .header {
116 | display: flex;
117 | padding: 8px;
118 | font-size: 0.875em;
119 | background: #444;
120 | color: #999; }
121 |
122 | .header-col {
123 | margin: 0;
124 | padding: 0 8px; }
125 |
126 | .header-col--primary {
127 | flex: 1; }
128 |
129 | .header-link {
130 | color: #fff; }
131 |
132 | .header-icon {
133 | padding-right: 6px;
134 | vertical-align: -4px;
135 | height: 16px; }
136 |
137 | .breadcrumbs {
138 | font-size: 0.875em;
139 | padding: 8px 16px;
140 | margin: 0;
141 | background: #fbfbfb;
142 | border-bottom: 1px solid #ddd; }
143 |
144 | .carat {
145 | height: 10px;
146 | margin: 0 5px; }
147 |
148 | .navigation {
149 | order: 2; }
150 | @media (min-width: 768px) {
151 | .navigation {
152 | order: 1;
153 | width: 25%;
154 | max-width: 300px;
155 | padding-bottom: 64px;
156 | overflow: hidden;
157 | word-wrap: normal;
158 | background: #fbfbfb;
159 | border-right: 1px solid #ddd; } }
160 |
161 | .nav-groups {
162 | list-style-type: none;
163 | padding-left: 0; }
164 |
165 | .nav-group-name {
166 | border-bottom: 1px solid #ddd;
167 | padding: 8px 0 8px 16px; }
168 |
169 | .nav-group-name-link {
170 | color: #333; }
171 |
172 | .nav-group-tasks {
173 | margin: 8px 0;
174 | padding: 0 0 0 8px; }
175 |
176 | .nav-group-task {
177 | font-size: 1em;
178 | list-style-type: none;
179 | white-space: nowrap; }
180 |
181 | .nav-group-task-link {
182 | color: #808080; }
183 |
184 | .main-content {
185 | order: 1; }
186 | @media (min-width: 768px) {
187 | .main-content {
188 | order: 2;
189 | flex: 1;
190 | padding-bottom: 60px; } }
191 |
192 | .section {
193 | padding: 0 32px;
194 | border-bottom: 1px solid #ddd; }
195 |
196 | .section-content {
197 | max-width: 834px;
198 | margin: 0 auto;
199 | padding: 16px 0; }
200 |
201 | .section-name {
202 | color: #666;
203 | display: block; }
204 |
205 | .declaration .highlight {
206 | overflow-x: initial;
207 | padding: 8px 0;
208 | margin: 0;
209 | background-color: transparent;
210 | border: none; }
211 |
212 | .task-group-section {
213 | border-top: 1px solid #ddd; }
214 |
215 | .task-group {
216 | padding-top: 0px; }
217 |
218 | .task-name-container a[name]:before {
219 | content: "";
220 | display: block; }
221 |
222 | .item-container {
223 | padding: 0; }
224 |
225 | .item {
226 | padding-top: 8px;
227 | width: 100%;
228 | list-style-type: none; }
229 | .item a[name]:before {
230 | content: "";
231 | display: block; }
232 | .item .token, .item .direct-link {
233 | padding-left: 3px;
234 | margin-left: 0px;
235 | font-size: 1rem; }
236 | .item .declaration-note {
237 | font-size: .85em;
238 | color: #808080;
239 | font-style: italic; }
240 |
241 | .pointer-container {
242 | border-bottom: 1px solid #ddd;
243 | left: -23px;
244 | padding-bottom: 13px;
245 | position: relative;
246 | width: 110%; }
247 |
248 | .pointer {
249 | left: 21px;
250 | top: 7px;
251 | display: block;
252 | position: absolute;
253 | width: 12px;
254 | height: 12px;
255 | border-left: 1px solid #ddd;
256 | border-top: 1px solid #ddd;
257 | background: #fff;
258 | transform: rotate(45deg); }
259 |
260 | .height-container {
261 | display: none;
262 | position: relative;
263 | width: 100%;
264 | overflow: hidden; }
265 | .height-container .section {
266 | background: #fff;
267 | border: 1px solid #ddd;
268 | border-top-width: 0;
269 | padding-top: 10px;
270 | padding-bottom: 5px;
271 | padding: 8px 16px; }
272 |
273 | .aside, .language {
274 | padding: 6px 12px;
275 | margin: 12px 0;
276 | border-left: 5px solid #dddddd;
277 | overflow-y: hidden; }
278 | .aside .aside-title, .language .aside-title {
279 | font-size: 9px;
280 | letter-spacing: 2px;
281 | text-transform: uppercase;
282 | padding-bottom: 0;
283 | margin: 0;
284 | color: #aaa;
285 | -webkit-user-select: none; }
286 | .aside p:last-child, .language p:last-child {
287 | margin-bottom: 0; }
288 |
289 | .language {
290 | border-left: 5px solid #cde9f4; }
291 | .language .aside-title {
292 | color: #4183c4; }
293 |
294 | .aside-warning, .aside-deprecated, .aside-unavailable {
295 | border-left: 5px solid #ff6666; }
296 | .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
297 | color: #ff0000; }
298 |
299 | .graybox {
300 | border-collapse: collapse;
301 | width: 100%; }
302 | .graybox p {
303 | margin: 0;
304 | word-break: break-word;
305 | min-width: 50px; }
306 | .graybox td {
307 | border: 1px solid #ddd;
308 | padding: 5px 25px 5px 10px;
309 | vertical-align: middle; }
310 | .graybox tr td:first-of-type {
311 | text-align: right;
312 | padding: 7px;
313 | vertical-align: top;
314 | word-break: normal;
315 | width: 40px; }
316 |
317 | .slightly-smaller {
318 | font-size: 0.9em; }
319 |
320 | .footer {
321 | padding: 8px 16px;
322 | background: #444;
323 | color: #ddd;
324 | font-size: 0.8em; }
325 | .footer p {
326 | margin: 8px 0; }
327 | .footer a {
328 | color: #fff; }
329 |
330 | html.dash .header, html.dash .breadcrumbs, html.dash .navigation {
331 | display: none; }
332 |
333 | html.dash .height-container {
334 | display: block; }
335 |
336 | form[role=search] input {
337 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
338 | font-size: 14px;
339 | line-height: 24px;
340 | padding: 0 10px;
341 | margin: 0;
342 | border: none;
343 | border-radius: 1em; }
344 | .loading form[role=search] input {
345 | background: white url(../img/spinner.gif) center right 4px no-repeat; }
346 |
347 | form[role=search] .tt-menu {
348 | margin: 0;
349 | min-width: 300px;
350 | background: #fbfbfb;
351 | color: #333;
352 | border: 1px solid #ddd; }
353 |
354 | form[role=search] .tt-highlight {
355 | font-weight: bold; }
356 |
357 | form[role=search] .tt-suggestion {
358 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
359 | padding: 0 8px; }
360 | form[role=search] .tt-suggestion span {
361 | display: table-cell;
362 | white-space: nowrap; }
363 | form[role=search] .tt-suggestion .doc-parent-name {
364 | width: 100%;
365 | text-align: right;
366 | font-weight: normal;
367 | font-size: 0.9em;
368 | padding-left: 16px; }
369 |
370 | form[role=search] .tt-suggestion:hover,
371 | form[role=search] .tt-suggestion.tt-cursor {
372 | cursor: pointer;
373 | background-color: #4183c4;
374 | color: #fff; }
375 |
376 | form[role=search] .tt-suggestion:hover .doc-parent-name,
377 | form[role=search] .tt-suggestion.tt-cursor .doc-parent-name {
378 | color: #fff; }
379 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIdentifier
6 | com.jazzy.shortlook api
7 | CFBundleName
8 | ShortLook API
9 | DocSetPlatformFamily
10 | shortlook api
11 | isDashDocset
12 |
13 | dashIndexFilePath
14 | index.html
15 | isJavaScriptEnabled
16 |
17 | DashDocSetFamily
18 | dashtoc
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/Classes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Classes Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | Classes Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
Classes
85 |
The following classes are available globally.
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
102 |
103 |
104 |
105 |
106 |
107 |
A ShortLook-displayable notification representing a real user notification sent by an application to the system.
108 |
109 |
See more
110 |
111 |
112 |
Declaration
113 |
114 |
Objective-C
115 |
@interface DDUserNotification
116 |
117 |
118 |
119 |
122 |
123 |
124 |
125 |
126 |
133 |
134 |
135 |
136 |
137 |
138 |
An object representing settings for the photo to be provided by a promise.
139 |
140 |
See more
141 |
142 |
143 |
Declaration
144 |
145 |
Objective-C
146 |
@interface DDNotificationContactPhotoSettings
147 |
148 |
149 |
150 |
153 |
154 |
155 |
156 |
157 |
164 |
165 |
166 |
167 |
168 |
169 |
A promise representing a commitment to providing a contact icon for a notification.
170 |
171 |
See more
172 |
173 |
174 |
Declaration
175 |
176 |
Objective-C
177 |
@interface DDNotificationContactPhotoPromise
178 |
179 |
180 |
181 |
184 |
185 |
186 |
187 |
188 |
195 |
196 |
197 |
198 |
199 |
200 |
An offer to fulfill a promise representing a commitment to providing a contact icon for a notification.
201 |
202 |
See more
203 |
204 |
205 |
Declaration
206 |
207 |
Objective-C
208 |
@interface DDNotificationContactPhotoPromiseOffer
209 |
210 |
211 |
212 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
229 |
230 |
231 |
232 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/Classes/DDNotificationContactPhotoPromise.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDNotificationContactPhotoPromise Class Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDNotificationContactPhotoPromise Class Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDNotificationContactPhotoPromise
85 |
86 |
87 |
@interface DDNotificationContactPhotoPromise
88 |
89 |
90 |
91 |
A promise representing a commitment to providing a contact icon for a notification.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | settings
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
An object holding the settings pertaining to the photo to be displayed.
114 |
115 |
116 |
117 |
Declaration
118 |
124 |
125 |
128 |
129 |
130 |
131 |
132 |
139 |
140 |
141 |
142 |
143 |
144 |
Whether or not this promise has already been resolved or rejected.
145 |
146 |
147 |
148 |
Declaration
149 |
150 |
Objective-C
151 |
@property ( nonatomic , assign , unsafe_unretained , readonly ) int isComplete ;
152 |
153 |
154 |
155 |
158 |
159 |
160 |
161 |
162 |
169 |
170 |
171 |
172 |
173 |
174 |
Resolve this promise with the provided image, notifying ShortLook that you have received your image.
175 |
176 |
Note
177 | This method should only be ran from within
addResolver:
.
178 |
179 |
180 |
181 |
182 |
183 |
Declaration
184 |
185 |
Objective-C
186 |
- ( void ) resolveWithImage :( id ) image ;
187 |
188 |
189 |
190 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 | -reject
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
Reject this promise, notifying ShortLook that you failed to receive an image.
210 |
211 |
Note
212 | This method should only be ran from within
addResolver:
.
213 |
214 |
215 |
216 |
217 |
218 |
Declaration
219 |
220 |
Objective-C
221 |
- ( void ) reject ;
222 |
223 |
224 |
225 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
242 |
243 |
244 |
245 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/Classes/DDNotificationContactPhotoSettings.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDNotificationContactPhotoSettings Class Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDNotificationContactPhotoSettings Class Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDNotificationContactPhotoSettings
85 |
86 |
87 |
@interface DDNotificationContactPhotoSettings
88 |
89 |
90 |
91 |
An object representing settings for the photo to be provided by a promise.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
108 |
109 |
110 |
111 |
112 |
113 |
The background colour to show for the contact photo view if the provided image contains any transparency.
114 |
115 |
116 |
117 |
Declaration
118 |
119 |
Objective-C
120 |
@property ( nonatomic , retain ) UIColor * backgroundColor
121 |
122 |
123 |
124 |
127 |
128 |
129 |
130 |
131 |
138 |
139 |
140 |
141 |
142 |
143 |
Whether or not ShortLook should automatically cache the returned image from your provider and use it for all future notifications with the same photo identifier and application.
144 |
145 |
146 |
147 |
Declaration
148 |
149 |
Objective-C
150 |
@property ( nonatomic , assign , unsafe_unretained , readwrite ) int usesCaching ;
151 |
152 |
153 |
154 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
171 |
172 |
173 |
174 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/Classes/DDUserNotification.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDUserNotification Class Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDUserNotification Class Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDUserNotification
85 |
86 |
87 |
@interface DDUserNotification
88 |
89 |
90 |
91 |
A ShortLook-displayable notification representing a real user notification sent by an application to the system.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
108 |
109 |
110 |
111 |
112 |
113 |
A custom notification title, separate from the application’s title.
114 |
115 |
116 |
117 |
Declaration
118 |
119 |
Objective-C
120 |
@property ( nonatomic , retain , readonly ) NSString * notificationTitle
121 |
122 |
123 |
124 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | userInfo
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
A dictionary of any extra information included by ShortLook.
144 |
145 |
146 |
147 |
Declaration
148 |
149 |
Objective-C
150 |
@property ( nonatomic , retain ) NSDictionary * userInfo
151 |
152 |
153 |
154 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 | request
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
The system notification request that created this notification.
174 |
175 |
176 |
177 |
Declaration
178 |
179 |
Objective-C
180 |
@property ( nonatomic , retain , readonly ) NCNotificationRequest * request ;
181 |
182 |
183 |
184 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 | -content
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
The user notification’s content, sent by the application.
204 |
205 |
206 |
207 |
Declaration
208 |
209 |
Objective-C
210 |
- ( UNNotificationContent * ) content ;
211 |
212 |
213 |
214 |
217 |
218 |
219 |
220 |
221 |
228 |
229 |
230 |
231 |
232 |
233 |
A dictionary of any extra information provided by the application sending the notification.
234 |
235 |
236 |
237 |
Declaration
238 |
239 |
Objective-C
240 |
- ( id ) applicationUserInfo ;
241 |
242 |
243 |
244 |
247 |
248 |
249 |
250 |
251 |
258 |
259 |
260 |
261 |
262 |
263 |
The bundle identifier of the application this notification represents.
264 |
265 |
266 |
267 |
Declaration
268 |
269 |
Objective-C
270 |
- ( id ) senderIdentifier ;
271 |
272 |
273 |
274 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
291 |
292 |
293 |
294 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/Protocols.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Protocols Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | Protocols Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
Protocols
85 |
The following protocols are available globally.
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
102 |
103 |
104 |
105 |
106 |
107 |
An object that can provide contact photos for ShortLook notifications.
108 |
109 |
See more
110 |
111 |
112 |
Declaration
113 |
114 |
Objective-C
115 |
@protocol DDNotificationContactPhotoProviding
116 |
117 |
118 |
119 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/Protocols/DDNotificationContactPhotoProviding.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DDNotificationContactPhotoProviding Protocol Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
43 |
44 |
45 | ShortLook API Reference
46 |
47 | DDNotificationContactPhotoProviding Protocol Reference
48 |
49 |
50 |
51 |
52 |
79 |
80 |
81 |
82 |
83 |
84 |
DDNotificationContactPhotoProviding
85 |
86 |
87 |
@protocol DDNotificationContactPhotoProviding
88 |
89 |
90 |
91 |
An object that can provide contact photos for ShortLook notifications.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
108 |
109 |
110 |
111 |
112 |
113 |
Returns an offer to fulfill a promise to provide a contact photo for a notification.
114 |
115 |
116 |
117 |
Declaration
118 |
124 |
125 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/css/highlight.css:
--------------------------------------------------------------------------------
1 | /* Credit to https://gist.github.com/wataru420/2048287 */
2 | .highlight {
3 | /* Comment */
4 | /* Error */
5 | /* Keyword */
6 | /* Operator */
7 | /* Comment.Multiline */
8 | /* Comment.Preproc */
9 | /* Comment.Single */
10 | /* Comment.Special */
11 | /* Generic.Deleted */
12 | /* Generic.Deleted.Specific */
13 | /* Generic.Emph */
14 | /* Generic.Error */
15 | /* Generic.Heading */
16 | /* Generic.Inserted */
17 | /* Generic.Inserted.Specific */
18 | /* Generic.Output */
19 | /* Generic.Prompt */
20 | /* Generic.Strong */
21 | /* Generic.Subheading */
22 | /* Generic.Traceback */
23 | /* Keyword.Constant */
24 | /* Keyword.Declaration */
25 | /* Keyword.Pseudo */
26 | /* Keyword.Reserved */
27 | /* Keyword.Type */
28 | /* Literal.Number */
29 | /* Literal.String */
30 | /* Name.Attribute */
31 | /* Name.Builtin */
32 | /* Name.Class */
33 | /* Name.Constant */
34 | /* Name.Entity */
35 | /* Name.Exception */
36 | /* Name.Function */
37 | /* Name.Namespace */
38 | /* Name.Tag */
39 | /* Name.Variable */
40 | /* Operator.Word */
41 | /* Text.Whitespace */
42 | /* Literal.Number.Float */
43 | /* Literal.Number.Hex */
44 | /* Literal.Number.Integer */
45 | /* Literal.Number.Oct */
46 | /* Literal.String.Backtick */
47 | /* Literal.String.Char */
48 | /* Literal.String.Doc */
49 | /* Literal.String.Double */
50 | /* Literal.String.Escape */
51 | /* Literal.String.Heredoc */
52 | /* Literal.String.Interpol */
53 | /* Literal.String.Other */
54 | /* Literal.String.Regex */
55 | /* Literal.String.Single */
56 | /* Literal.String.Symbol */
57 | /* Name.Builtin.Pseudo */
58 | /* Name.Variable.Class */
59 | /* Name.Variable.Global */
60 | /* Name.Variable.Instance */
61 | /* Literal.Number.Integer.Long */ }
62 | .highlight .c {
63 | color: #999988;
64 | font-style: italic; }
65 | .highlight .err {
66 | color: #a61717;
67 | background-color: #e3d2d2; }
68 | .highlight .k {
69 | color: #000000;
70 | font-weight: bold; }
71 | .highlight .o {
72 | color: #000000;
73 | font-weight: bold; }
74 | .highlight .cm {
75 | color: #999988;
76 | font-style: italic; }
77 | .highlight .cp {
78 | color: #999999;
79 | font-weight: bold; }
80 | .highlight .c1 {
81 | color: #999988;
82 | font-style: italic; }
83 | .highlight .cs {
84 | color: #999999;
85 | font-weight: bold;
86 | font-style: italic; }
87 | .highlight .gd {
88 | color: #000000;
89 | background-color: #ffdddd; }
90 | .highlight .gd .x {
91 | color: #000000;
92 | background-color: #ffaaaa; }
93 | .highlight .ge {
94 | color: #000000;
95 | font-style: italic; }
96 | .highlight .gr {
97 | color: #aa0000; }
98 | .highlight .gh {
99 | color: #999999; }
100 | .highlight .gi {
101 | color: #000000;
102 | background-color: #ddffdd; }
103 | .highlight .gi .x {
104 | color: #000000;
105 | background-color: #aaffaa; }
106 | .highlight .go {
107 | color: #888888; }
108 | .highlight .gp {
109 | color: #555555; }
110 | .highlight .gs {
111 | font-weight: bold; }
112 | .highlight .gu {
113 | color: #aaaaaa; }
114 | .highlight .gt {
115 | color: #aa0000; }
116 | .highlight .kc {
117 | color: #000000;
118 | font-weight: bold; }
119 | .highlight .kd {
120 | color: #000000;
121 | font-weight: bold; }
122 | .highlight .kp {
123 | color: #000000;
124 | font-weight: bold; }
125 | .highlight .kr {
126 | color: #000000;
127 | font-weight: bold; }
128 | .highlight .kt {
129 | color: #445588; }
130 | .highlight .m {
131 | color: #009999; }
132 | .highlight .s {
133 | color: #d14; }
134 | .highlight .na {
135 | color: #008080; }
136 | .highlight .nb {
137 | color: #0086B3; }
138 | .highlight .nc {
139 | color: #445588;
140 | font-weight: bold; }
141 | .highlight .no {
142 | color: #008080; }
143 | .highlight .ni {
144 | color: #800080; }
145 | .highlight .ne {
146 | color: #990000;
147 | font-weight: bold; }
148 | .highlight .nf {
149 | color: #990000; }
150 | .highlight .nn {
151 | color: #555555; }
152 | .highlight .nt {
153 | color: #000080; }
154 | .highlight .nv {
155 | color: #008080; }
156 | .highlight .ow {
157 | color: #000000;
158 | font-weight: bold; }
159 | .highlight .w {
160 | color: #bbbbbb; }
161 | .highlight .mf {
162 | color: #009999; }
163 | .highlight .mh {
164 | color: #009999; }
165 | .highlight .mi {
166 | color: #009999; }
167 | .highlight .mo {
168 | color: #009999; }
169 | .highlight .sb {
170 | color: #d14; }
171 | .highlight .sc {
172 | color: #d14; }
173 | .highlight .sd {
174 | color: #d14; }
175 | .highlight .s2 {
176 | color: #d14; }
177 | .highlight .se {
178 | color: #d14; }
179 | .highlight .sh {
180 | color: #d14; }
181 | .highlight .si {
182 | color: #d14; }
183 | .highlight .sx {
184 | color: #d14; }
185 | .highlight .sr {
186 | color: #009926; }
187 | .highlight .s1 {
188 | color: #d14; }
189 | .highlight .ss {
190 | color: #990073; }
191 | .highlight .bp {
192 | color: #999999; }
193 | .highlight .vc {
194 | color: #008080; }
195 | .highlight .vg {
196 | color: #008080; }
197 | .highlight .vi {
198 | color: #008080; }
199 | .highlight .il {
200 | color: #009999; }
201 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/css/jazzy.css:
--------------------------------------------------------------------------------
1 | *, *:before, *:after {
2 | box-sizing: inherit; }
3 |
4 | body {
5 | margin: 0;
6 | background: #fff;
7 | color: #333;
8 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
9 | letter-spacing: .2px;
10 | -webkit-font-smoothing: antialiased;
11 | box-sizing: border-box; }
12 |
13 | h1 {
14 | font-size: 2rem;
15 | font-weight: 700;
16 | margin: 1.275em 0 0.6em; }
17 |
18 | h2 {
19 | font-size: 1.75rem;
20 | font-weight: 700;
21 | margin: 1.275em 0 0.3em; }
22 |
23 | h3 {
24 | font-size: 1.5rem;
25 | font-weight: 700;
26 | margin: 1em 0 0.3em; }
27 |
28 | h4 {
29 | font-size: 1.25rem;
30 | font-weight: 700;
31 | margin: 1.275em 0 0.85em; }
32 |
33 | h5 {
34 | font-size: 1rem;
35 | font-weight: 700;
36 | margin: 1.275em 0 0.85em; }
37 |
38 | h6 {
39 | font-size: 1rem;
40 | font-weight: 700;
41 | margin: 1.275em 0 0.85em;
42 | color: #777; }
43 |
44 | p {
45 | margin: 0 0 1em; }
46 |
47 | ul, ol {
48 | padding: 0 0 0 2em;
49 | margin: 0 0 0.85em; }
50 |
51 | blockquote {
52 | margin: 0 0 0.85em;
53 | padding: 0 15px;
54 | color: #858585;
55 | border-left: 4px solid #e5e5e5; }
56 |
57 | img {
58 | max-width: 100%; }
59 |
60 | a {
61 | color: #4183c4;
62 | text-decoration: none; }
63 | a:hover, a:focus {
64 | outline: 0;
65 | text-decoration: underline; }
66 | a.discouraged {
67 | text-decoration: line-through; }
68 | a.discouraged:hover, a.discouraged:focus {
69 | text-decoration: underline line-through; }
70 |
71 | table {
72 | background: #fff;
73 | width: 100%;
74 | border-collapse: collapse;
75 | border-spacing: 0;
76 | overflow: auto;
77 | margin: 0 0 0.85em; }
78 |
79 | tr:nth-child(2n) {
80 | background-color: #fbfbfb; }
81 |
82 | th, td {
83 | padding: 6px 13px;
84 | border: 1px solid #ddd; }
85 |
86 | pre {
87 | margin: 0 0 1.275em;
88 | padding: .85em 1em;
89 | overflow: auto;
90 | background: #f7f7f7;
91 | font-size: .85em;
92 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
93 |
94 | code {
95 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
96 |
97 | p > code, li > code {
98 | background: #f7f7f7;
99 | padding: .2em; }
100 | p > code:before, p > code:after, li > code:before, li > code:after {
101 | letter-spacing: -.2em;
102 | content: "\00a0"; }
103 |
104 | pre code {
105 | padding: 0;
106 | white-space: pre; }
107 |
108 | .content-wrapper {
109 | display: flex;
110 | flex-direction: column; }
111 | @media (min-width: 768px) {
112 | .content-wrapper {
113 | flex-direction: row; } }
114 |
115 | .header {
116 | display: flex;
117 | padding: 8px;
118 | font-size: 0.875em;
119 | background: #444;
120 | color: #999; }
121 |
122 | .header-col {
123 | margin: 0;
124 | padding: 0 8px; }
125 |
126 | .header-col--primary {
127 | flex: 1; }
128 |
129 | .header-link {
130 | color: #fff; }
131 |
132 | .header-icon {
133 | padding-right: 6px;
134 | vertical-align: -4px;
135 | height: 16px; }
136 |
137 | .breadcrumbs {
138 | font-size: 0.875em;
139 | padding: 8px 16px;
140 | margin: 0;
141 | background: #fbfbfb;
142 | border-bottom: 1px solid #ddd; }
143 |
144 | .carat {
145 | height: 10px;
146 | margin: 0 5px; }
147 |
148 | .navigation {
149 | order: 2; }
150 | @media (min-width: 768px) {
151 | .navigation {
152 | order: 1;
153 | width: 25%;
154 | max-width: 300px;
155 | padding-bottom: 64px;
156 | overflow: hidden;
157 | word-wrap: normal;
158 | background: #fbfbfb;
159 | border-right: 1px solid #ddd; } }
160 |
161 | .nav-groups {
162 | list-style-type: none;
163 | padding-left: 0; }
164 |
165 | .nav-group-name {
166 | border-bottom: 1px solid #ddd;
167 | padding: 8px 0 8px 16px; }
168 |
169 | .nav-group-name-link {
170 | color: #333; }
171 |
172 | .nav-group-tasks {
173 | margin: 8px 0;
174 | padding: 0 0 0 8px; }
175 |
176 | .nav-group-task {
177 | font-size: 1em;
178 | list-style-type: none;
179 | white-space: nowrap; }
180 |
181 | .nav-group-task-link {
182 | color: #808080; }
183 |
184 | .main-content {
185 | order: 1; }
186 | @media (min-width: 768px) {
187 | .main-content {
188 | order: 2;
189 | flex: 1;
190 | padding-bottom: 60px; } }
191 |
192 | .section {
193 | padding: 0 32px;
194 | border-bottom: 1px solid #ddd; }
195 |
196 | .section-content {
197 | max-width: 834px;
198 | margin: 0 auto;
199 | padding: 16px 0; }
200 |
201 | .section-name {
202 | color: #666;
203 | display: block; }
204 |
205 | .declaration .highlight {
206 | overflow-x: initial;
207 | padding: 8px 0;
208 | margin: 0;
209 | background-color: transparent;
210 | border: none; }
211 |
212 | .task-group-section {
213 | border-top: 1px solid #ddd; }
214 |
215 | .task-group {
216 | padding-top: 0px; }
217 |
218 | .task-name-container a[name]:before {
219 | content: "";
220 | display: block; }
221 |
222 | .item-container {
223 | padding: 0; }
224 |
225 | .item {
226 | padding-top: 8px;
227 | width: 100%;
228 | list-style-type: none; }
229 | .item a[name]:before {
230 | content: "";
231 | display: block; }
232 | .item .token, .item .direct-link {
233 | padding-left: 3px;
234 | margin-left: 0px;
235 | font-size: 1rem; }
236 | .item .declaration-note {
237 | font-size: .85em;
238 | color: #808080;
239 | font-style: italic; }
240 |
241 | .pointer-container {
242 | border-bottom: 1px solid #ddd;
243 | left: -23px;
244 | padding-bottom: 13px;
245 | position: relative;
246 | width: 110%; }
247 |
248 | .pointer {
249 | left: 21px;
250 | top: 7px;
251 | display: block;
252 | position: absolute;
253 | width: 12px;
254 | height: 12px;
255 | border-left: 1px solid #ddd;
256 | border-top: 1px solid #ddd;
257 | background: #fff;
258 | transform: rotate(45deg); }
259 |
260 | .height-container {
261 | display: none;
262 | position: relative;
263 | width: 100%;
264 | overflow: hidden; }
265 | .height-container .section {
266 | background: #fff;
267 | border: 1px solid #ddd;
268 | border-top-width: 0;
269 | padding-top: 10px;
270 | padding-bottom: 5px;
271 | padding: 8px 16px; }
272 |
273 | .aside, .language {
274 | padding: 6px 12px;
275 | margin: 12px 0;
276 | border-left: 5px solid #dddddd;
277 | overflow-y: hidden; }
278 | .aside .aside-title, .language .aside-title {
279 | font-size: 9px;
280 | letter-spacing: 2px;
281 | text-transform: uppercase;
282 | padding-bottom: 0;
283 | margin: 0;
284 | color: #aaa;
285 | -webkit-user-select: none; }
286 | .aside p:last-child, .language p:last-child {
287 | margin-bottom: 0; }
288 |
289 | .language {
290 | border-left: 5px solid #cde9f4; }
291 | .language .aside-title {
292 | color: #4183c4; }
293 |
294 | .aside-warning, .aside-deprecated, .aside-unavailable {
295 | border-left: 5px solid #ff6666; }
296 | .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
297 | color: #ff0000; }
298 |
299 | .graybox {
300 | border-collapse: collapse;
301 | width: 100%; }
302 | .graybox p {
303 | margin: 0;
304 | word-break: break-word;
305 | min-width: 50px; }
306 | .graybox td {
307 | border: 1px solid #ddd;
308 | padding: 5px 25px 5px 10px;
309 | vertical-align: middle; }
310 | .graybox tr td:first-of-type {
311 | text-align: right;
312 | padding: 7px;
313 | vertical-align: top;
314 | word-break: normal;
315 | width: 40px; }
316 |
317 | .slightly-smaller {
318 | font-size: 0.9em; }
319 |
320 | .footer {
321 | padding: 8px 16px;
322 | background: #444;
323 | color: #ddd;
324 | font-size: 0.8em; }
325 | .footer p {
326 | margin: 8px 0; }
327 | .footer a {
328 | color: #fff; }
329 |
330 | html.dash .header, html.dash .breadcrumbs, html.dash .navigation {
331 | display: none; }
332 |
333 | html.dash .height-container {
334 | display: block; }
335 |
336 | form[role=search] input {
337 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
338 | font-size: 14px;
339 | line-height: 24px;
340 | padding: 0 10px;
341 | margin: 0;
342 | border: none;
343 | border-radius: 1em; }
344 | .loading form[role=search] input {
345 | background: white url(../img/spinner.gif) center right 4px no-repeat; }
346 |
347 | form[role=search] .tt-menu {
348 | margin: 0;
349 | min-width: 300px;
350 | background: #fbfbfb;
351 | color: #333;
352 | border: 1px solid #ddd; }
353 |
354 | form[role=search] .tt-highlight {
355 | font-weight: bold; }
356 |
357 | form[role=search] .tt-suggestion {
358 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
359 | padding: 0 8px; }
360 | form[role=search] .tt-suggestion span {
361 | display: table-cell;
362 | white-space: nowrap; }
363 | form[role=search] .tt-suggestion .doc-parent-name {
364 | width: 100%;
365 | text-align: right;
366 | font-weight: normal;
367 | font-size: 0.9em;
368 | padding-left: 16px; }
369 |
370 | form[role=search] .tt-suggestion:hover,
371 | form[role=search] .tt-suggestion.tt-cursor {
372 | cursor: pointer;
373 | background-color: #4183c4;
374 | color: #fff; }
375 |
376 | form[role=search] .tt-suggestion:hover .doc-parent-name,
377 | form[role=search] .tt-suggestion.tt-cursor .doc-parent-name {
378 | color: #fff; }
379 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/carat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/carat.png
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/dash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/dash.png
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/gh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/gh.png
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/img/spinner.gif
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ShortLook API Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
42 |
43 |
44 | ShortLook API Reference
45 |
46 | ShortLook API Reference
47 |
48 |
49 |
50 |
51 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
ShortLook API Reference
85 |
Table of Contents
86 |
87 |
91 |
92 |
93 |
94 |
95 |
Use the ShortLook API to create plugins that provide contact icons for third-party applications to ShortLook.
96 |
97 |
102 |
Quick Start
103 |
104 |
105 | Setup your development environment just as you would to make tweaks, including Theos.
106 | Download the API template and extract it’s contents.
107 | Rename your main class (DD_RENAMETHIS_ContactPhotoProvider).
108 | Using the Info.plist reference , change any values you may need to in Info.plist
.
109 | Implement your logic inside your main class’s contactPhotoPromiseOfferForNotification:
method (details ).
110 | Configure your Makefile
and control
as you would a normal tweak, using these tips .
111 |
112 |
Photo Recommendations
113 |
114 |
115 | Any format supported by iOS.
116 | Around 1:1 in aspect ratio (or else it will be zoomed in).
117 | Above 152x152px
in size (@3x
, preferably).
118 |
119 |
Provider Structure and Explanation
120 |
121 |
Every provider plugin must have the following two things:
122 |
123 |
127 |
Info.plist
128 |
129 |
The Info.plist
file specifies to ShortLook how it should load and handle this provider plugin internally. Every Info.plist file should have the following keys:
130 |
131 |
132 | CFBundleDisplayName
, string : A short name for what this plugin provides. In most cases, it should just be the name of the app you are providing for (e.g., Twitter).
133 | DDNotificationExternalProviderClasses
dictionary : A dictionary of provider classes, and the bundle identifiers they provide for. The key should represent your class name, and it’s value may be either a string or array of strings containing the bundle identifiers of apps to provide for.
134 | DDNotificationExternalProviderAPIVersion
integer : Must equal 1. The ShortLook API version to use. This is to ensure that future updates with potentially breaking API changes do not crash ShortLook. These will be rare, if ever, but exists for future-proofing.
135 |
136 |
137 |
If you’d like to see a working version, check out an example of Info.plist here .
138 |
Provider classes
139 |
140 |
Now that you’ve declared how ShortLook should load your plugin, you can start implementing the operations to receive contact photos.
141 |
142 |
You will make a class that inherits from NSObject
and conforms to DDNotificationContactPhotoProviding
. You should import ShortLook-API.h
in your project for ease of use.
143 |
144 |
Each provider class implements the following method:
145 |
/// Returns an offer to fulfill a promise to provide a contact photo for a notification.
146 | - ( DDNotificationContactPhotoPromiseOffer * ) contactPhotoPromiseOfferForNotification :( DDUserNotification * ) notification ;
147 |
148 |
149 |
If you’d like to see a working version, check out an example of a provider class here .
150 |
151 |
152 | Heads up! Make sure your provider’s class is unique (rename it if you used an example). In Objective-C, there may only have one class for a name. If any other classes exist with that name, your provider will crash the system.
153 |
154 |
Promises and Offers
155 |
156 |
When ShortLook asks you for a photo, you first return an object called an Offer (if you don’t want to provide for a notification, return nil
). This offer is simple: you provide the photo identifier, and then set a block that will be called if ShortLook needs your provider. A parameter on this block you set is an object called a Promise . While this promise doesn’t directly contain your image at first, it eventually will be used to contain one by your provider. It is, in most basic terms, a promise to provide a contact photo. Since most provider’s images will take a while to get (network requests, etc.), this is necessary to ensure optimal performance.
157 |
158 |
You initialize your offer with a photo identifier , which is a unique string for the contact photo you will provide, for internal use by ShortLook (such as caching, or choosing when to display the image). For the system contact photo provider, this identifier is the phone number or email address of the notification. For a provider like Twitter, it is the URL of the profile photo. For another social network, you may opt to use the photo’s account’s screen name, it that’s more appropriate. Whatever your identifier be, just ensure it represents the photo you will return uniquely.
159 |
160 |
Once you have initialized your offer object, you can add a resolver using fulfillWithBlock:
. The block you provide here should contain every next operation for grabbing the contact photo, such as network requests. Once you have received your image, pass it back to ShortLook by calling resolveWithImage:
on your promise, which is a parameter of your block. If an error occurs and you are not able to fetch a contact photo for the user, call reject
on the promise. Once you’ve resolved or rejected a promise, you may not do so it again, such as to change the image.
161 |
162 |
The promise object also features many properties, such as usesCaching
and backgroundColor
, which can be set at any time before the promise is completed.
163 |
What if I can get my image instantly?
164 |
165 |
If your image is returned instantly, rather than by using a network request, you can use a convenience method on DDNotificationContactPhotoPromiseOffer
, named offerInstantlyResolvingPromiseWithPhotoIdentifier:image:
. Just return the generated promise from your provider. Choose wisely, though. This method should only be used if you can get your image absolutely instantly. If you take too long using this synchronous method, ShortLook may penalize your provider.
166 |
167 |
168 |
169 | Your package should usually be called something like APP Photo Provider for ShortLook in Cydia.
170 | It is recommended you make your bundle name something like ShortLook-APP .
171 |
172 |
Full Documentation
173 |
174 |
You can view the full class documentation for ShortLook’s photo provider API here .
175 |
Examples
176 |
177 |
You can look at the following open source provider examples to get an idea of how to use the ShortLook API:
178 |
179 |
183 |
184 |
185 |
Always-on Screen State Provider
186 |
187 |
Starting in version 1.0.2, ShortLook provides an external coordination API for non-Dynastic tweaks to use. It will allow these tweaks to provide the screen’s display on state, since some tweaks fake the screen being off on OLED phones.
188 |
189 |
If your tweak keeps the screen on while the user would expect it to be off, ShortLook can obey this preference and behave like the screen is off.
190 |
191 |
First, implement the following provider in a class where you wish to provide this information:
192 |
@protocol DDLunarScreenStateProvider < NSObject >
193 | @required
194 | /// If your tweak keeps the screen awake to provide an always-on experience but should act to Lunar like the display is off, return whether you want the screen to be treated as on or off here. If any single provider is returning NO for this, the screen will be treated as such.
195 | - ( BOOL ) isScreenOn ;
196 | @end
197 |
198 |
199 |
Once you have implemented that, you must register an instance of this class using DDLunarScreenStateManager
. You can call registerScreenStateProvider:
on the shared manager to tell ShortLook to ask your provider before deciding how to treat the screen state, using the following header:
200 |
@interface DDLunarScreenStateManager : NSObject
201 | + ( instancetype ) sharedManager ;
202 | - ( void ) registerScreenStateProvider :( NSObject < DDLunarScreenStateProvider > * ) provider ;
203 | - ( void ) deregisterScreenStateProvider :( NSObject < DDLunarScreenStateProvider > * ) provider ;
204 | @end
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
217 |
218 |
219 |
220 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/js/jazzy.js:
--------------------------------------------------------------------------------
1 | window.jazzy = {'docset': false}
2 | if (typeof window.dash != 'undefined') {
3 | document.documentElement.className += ' dash'
4 | window.jazzy.docset = true
5 | }
6 | if (navigator.userAgent.match(/xcode/i)) {
7 | document.documentElement.className += ' xcode'
8 | window.jazzy.docset = true
9 | }
10 |
11 | function toggleItem($link, $content) {
12 | var animationDuration = 300;
13 | $link.toggleClass('token-open');
14 | $content.slideToggle(animationDuration);
15 | }
16 |
17 | function itemLinkToContent($link) {
18 | return $link.parent().parent().next();
19 | }
20 |
21 | // On doc load + hash-change, open any targetted item
22 | function openCurrentItemIfClosed() {
23 | if (window.jazzy.docset) {
24 | return;
25 | }
26 | var $link = $(`.token[href="${location.hash}"]`);
27 | $content = itemLinkToContent($link);
28 | if ($content.is(':hidden')) {
29 | toggleItem($link, $content);
30 | }
31 | }
32 |
33 | $(openCurrentItemIfClosed);
34 | $(window).on('hashchange', openCurrentItemIfClosed);
35 |
36 | // On item link ('token') click, toggle its discussion
37 | $('.token').on('click', function(event) {
38 | if (window.jazzy.docset) {
39 | return;
40 | }
41 | var $link = $(this);
42 | toggleItem($link, itemLinkToContent($link));
43 |
44 | // Keeps the document from jumping to the hash.
45 | var href = $link.attr('href');
46 | if (history.pushState) {
47 | history.pushState({}, '', href);
48 | } else {
49 | location.hash = href;
50 | }
51 | event.preventDefault();
52 | });
53 |
54 | // Clicks on links to the current, closed, item need to open the item
55 | $("a:not('.token')").on('click', function() {
56 | if (location == this.href) {
57 | openCurrentItemIfClosed();
58 | }
59 | });
60 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | $(function(){
2 | var $typeahead = $('[data-typeahead]');
3 | var $form = $typeahead.parents('form');
4 | var searchURL = $form.attr('action');
5 |
6 | function displayTemplate(result) {
7 | return result.name;
8 | }
9 |
10 | function suggestionTemplate(result) {
11 | var t = '';
12 | t += '' + result.name + ' ';
13 | if (result.parent_name) {
14 | t += '' + result.parent_name + ' ';
15 | }
16 | t += '
';
17 | return t;
18 | }
19 |
20 | $typeahead.one('focus', function() {
21 | $form.addClass('loading');
22 |
23 | $.getJSON(searchURL).then(function(searchData) {
24 | const searchIndex = lunr(function() {
25 | this.ref('url');
26 | this.field('name');
27 | this.field('abstract');
28 | for (const [url, doc] of Object.entries(searchData)) {
29 | this.add({url: url, name: doc.name, abstract: doc.abstract});
30 | }
31 | });
32 |
33 | $typeahead.typeahead(
34 | {
35 | highlight: true,
36 | minLength: 3,
37 | autoselect: true
38 | },
39 | {
40 | limit: 10,
41 | display: displayTemplate,
42 | templates: { suggestion: suggestionTemplate },
43 | source: function(query, sync) {
44 | const lcSearch = query.toLowerCase();
45 | const results = searchIndex.query(function(q) {
46 | q.term(lcSearch, { boost: 100 });
47 | q.term(lcSearch, {
48 | boost: 10,
49 | wildcard: lunr.Query.wildcard.TRAILING
50 | });
51 | }).map(function(result) {
52 | var doc = searchData[result.ref];
53 | doc.url = result.ref;
54 | return doc;
55 | });
56 | sync(results);
57 | }
58 | }
59 | );
60 | $form.removeClass('loading');
61 | $typeahead.trigger('focus');
62 | });
63 | });
64 |
65 | var baseURL = searchURL.slice(0, -"search.json".length);
66 |
67 | $typeahead.on('typeahead:select', function(e, result) {
68 | window.location = baseURL + result.url;
69 | });
70 | });
71 |
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/Documents/search.json:
--------------------------------------------------------------------------------
1 | {"Protocols/DDNotificationContactPhotoProviding.html#/c:objc(pl)DDNotificationContactPhotoProviding(im)contactPhotoPromiseOfferForNotification:":{"name":"-contactPhotoPromiseOfferForNotification:","abstract":"Returns an offer to fulfill a promise to provide a contact photo for a notification.
","parent_name":"DDNotificationContactPhotoProviding"},"Protocols/DDNotificationContactPhotoProviding.html":{"name":"DDNotificationContactPhotoProviding","abstract":"An object that can provide contact photos for ShortLook notifications.
"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)photoIdentifier":{"name":"photoIdentifier","abstract":"A unique identifier for the photo that will be provided by this promise.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)titleOverride":{"name":"titleOverride","abstract":"A string to replace the notification’s title with, if it is required for your provider’s context. Set to “” to remove the provided notification’s title.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)subtitleOverride":{"name":"subtitleOverride","abstract":"A string to replace the notification’s subtitle with, if it is required for your provider’s context. Set to “” to remove the provided notification’s subtitle.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)bodyOverride":{"name":"bodyOverride","abstract":"A string to replace the notification’s body with, if it is required for your provider’s context. Set to “” to remove the provided notification’s body.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(im)initWithPhotoIdentifier:":{"name":"-initWithPhotoIdentifier:","abstract":"Initialize a promise with the provided photo identifier.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerDownloadingPromiseWithPhotoIdentifier:fromURL:":{"name":"+offerDownloadingPromiseWithPhotoIdentifier:fromURL:","abstract":"Create a promise offer that will return the image at the provided URL, if needed.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerDownloadingPromiseWithPhotoIdentifier:fromURL:withSettings:":{"name":"+offerDownloadingPromiseWithPhotoIdentifier:fromURL:withSettings:","abstract":"Create a promise offer that will return the image at the provided URL, if needed, with custom settings.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerInstantlyResolvingPromiseWithPhotoIdentifier:image:":{"name":"+offerInstantlyResolvingPromiseWithPhotoIdentifier:image:","abstract":"Create a promise offer that will instantly return the provided image.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerInstantlyResolvingPromiseWithPhotoIdentifier:image:withSettings:":{"name":"+offerInstantlyResolvingPromiseWithPhotoIdentifier:image:withSettings:","abstract":"Create a promise offer that will instantly return the provided image with custom settings.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(im)fulfillWithBlock:":{"name":"-fulfillWithBlock:","abstract":"Add the block that will run if your image is needed (as it will not be in some cases, such as if your image is already cached by ShortLook).","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(py)settings":{"name":"settings","abstract":"
An object holding the settings pertaining to the photo to be displayed.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(py)isComplete":{"name":"isComplete","abstract":"Whether or not this promise has already been resolved or rejected.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(im)resolveWithImage:":{"name":"-resolveWithImage:","abstract":"Resolve this promise with the provided image, notifying ShortLook that you have received your image.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(im)reject":{"name":"-reject","abstract":"Reject this promise, notifying ShortLook that you failed to receive an image.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoSettings.html#/c:objc(cs)DDNotificationContactPhotoSettings(py)backgroundColor":{"name":"backgroundColor","abstract":"The background colour to show for the contact photo view if the provided image contains any transparency.
","parent_name":"DDNotificationContactPhotoSettings"},"Classes/DDNotificationContactPhotoSettings.html#/c:objc(cs)DDNotificationContactPhotoSettings(py)usesCaching":{"name":"usesCaching","abstract":"Whether or not ShortLook should automatically cache the returned image from your provider and use it for all future notifications with the same photo identifier and application.
","parent_name":"DDNotificationContactPhotoSettings"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(py)notificationTitle":{"name":"notificationTitle","abstract":"A custom notification title, separate from the application’s title.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(py)userInfo":{"name":"userInfo","abstract":"A dictionary of any extra information included by ShortLook.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(py)request":{"name":"request","abstract":"The system notification request that created this notification.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(im)content":{"name":"-content","abstract":"The user notification’s content, sent by the application.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(im)applicationUserInfo":{"name":"-applicationUserInfo","abstract":"A dictionary of any extra information provided by the application sending the notification.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(im)senderIdentifier":{"name":"-senderIdentifier","abstract":"The bundle identifier of the application this notification represents.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html":{"name":"DDUserNotification","abstract":"A ShortLook-displayable notification representing a real user notification sent by an application to the system.
"},"Classes/DDNotificationContactPhotoSettings.html":{"name":"DDNotificationContactPhotoSettings","abstract":"An object representing settings for the photo to be provided by a promise.
"},"Classes/DDNotificationContactPhotoPromise.html":{"name":"DDNotificationContactPhotoPromise","abstract":"A promise representing a commitment to providing a contact icon for a notification.
"},"Classes/DDNotificationContactPhotoPromiseOffer.html":{"name":"DDNotificationContactPhotoPromiseOffer","abstract":"An offer to fulfill a promise representing a commitment to providing a contact icon for a notification.
"},"Classes.html":{"name":"Classes","abstract":"The following classes are available globally.
"},"Protocols.html":{"name":"Protocols","abstract":"The following protocols are available globally.
"}}
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.docset/Contents/Resources/docSet.dsidx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/docsets/ShortLook API.docset/Contents/Resources/docSet.dsidx
--------------------------------------------------------------------------------
/docs/docsets/ShortLook API.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/docsets/ShortLook API.tgz
--------------------------------------------------------------------------------
/docs/img/carat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/img/carat.png
--------------------------------------------------------------------------------
/docs/img/dash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/img/dash.png
--------------------------------------------------------------------------------
/docs/img/gh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/img/gh.png
--------------------------------------------------------------------------------
/docs/img/spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynastic/ShortLook-API/856139b1a6abac19beaa6b1175e490eedf094848/docs/img/spinner.gif
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ShortLook API Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
42 |
43 |
44 | ShortLook API Reference
45 |
46 | ShortLook API Reference
47 |
48 |
49 |
50 |
51 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
ShortLook API Reference
85 |
Table of Contents
86 |
87 |
91 |
92 |
93 |
94 |
95 |
Use the ShortLook API to create plugins that provide contact icons for third-party applications to ShortLook.
96 |
97 |
102 |
Quick Start
103 |
104 |
105 | Setup your development environment just as you would to make tweaks, including Theos.
106 | Download the API template and extract it’s contents.
107 | Rename your main class (DD_RENAMETHIS_ContactPhotoProvider).
108 | Using the Info.plist reference , change any values you may need to in Info.plist
.
109 | Implement your logic inside your main class’s contactPhotoPromiseOfferForNotification:
method (details ).
110 | Configure your Makefile
and control
as you would a normal tweak, using these tips .
111 |
112 |
Photo Recommendations
113 |
114 |
115 | Any format supported by iOS.
116 | Around 1:1 in aspect ratio (or else it will be zoomed in).
117 | Above 152x152px
in size (@3x
, preferably).
118 |
119 |
Provider Structure and Explanation
120 |
121 |
Every provider plugin must have the following two things:
122 |
123 |
127 |
Info.plist
128 |
129 |
The Info.plist
file specifies to ShortLook how it should load and handle this provider plugin internally. Every Info.plist file should have the following keys:
130 |
131 |
132 | CFBundleDisplayName
, string : A short name for what this plugin provides. In most cases, it should just be the name of the app you are providing for (e.g., Twitter).
133 | DDNotificationExternalProviderClasses
dictionary : A dictionary of provider classes, and the bundle identifiers they provide for. The key should represent your class name, and it’s value may be either a string or array of strings containing the bundle identifiers of apps to provide for.
134 | DDNotificationExternalProviderAPIVersion
integer : Must equal 1. The ShortLook API version to use. This is to ensure that future updates with potentially breaking API changes do not crash ShortLook. These will be rare, if ever, but exists for future-proofing.
135 |
136 |
137 |
If you’d like to see a working version, check out an example of Info.plist here .
138 |
Provider classes
139 |
140 |
Now that you’ve declared how ShortLook should load your plugin, you can start implementing the operations to receive contact photos.
141 |
142 |
You will make a class that inherits from NSObject
and conforms to DDNotificationContactPhotoProviding
. You should import ShortLook-API.h
in your project for ease of use.
143 |
144 |
Each provider class implements the following method:
145 |
/// Returns an offer to fulfill a promise to provide a contact photo for a notification.
146 | - ( DDNotificationContactPhotoPromiseOffer * ) contactPhotoPromiseOfferForNotification :( DDUserNotification * ) notification ;
147 |
148 |
149 |
If you’d like to see a working version, check out an example of a provider class here .
150 |
151 |
152 | Heads up! Make sure your provider’s class is unique (rename it if you used an example). In Objective-C, there may only have one class for a name. If any other classes exist with that name, your provider will crash the system.
153 |
154 |
Promises and Offers
155 |
156 |
When ShortLook asks you for a photo, you first return an object called an Offer (if you don’t want to provide for a notification, return nil
). This offer is simple: you provide the photo identifier, and then set a block that will be called if ShortLook needs your provider. A parameter on this block you set is an object called a Promise . While this promise doesn’t directly contain your image at first, it eventually will be used to contain one by your provider. It is, in most basic terms, a promise to provide a contact photo. Since most provider’s images will take a while to get (network requests, etc.), this is necessary to ensure optimal performance.
157 |
158 |
You initialize your offer with a photo identifier , which is a unique string for the contact photo you will provide, for internal use by ShortLook (such as caching, or choosing when to display the image). For the system contact photo provider, this identifier is the phone number or email address of the notification. For a provider like Twitter, it is the URL of the profile photo. For another social network, you may opt to use the photo’s account’s screen name, it that’s more appropriate. Whatever your identifier be, just ensure it represents the photo you will return uniquely.
159 |
160 |
Once you have initialized your offer object, you can add a resolver using fulfillWithBlock:
. The block you provide here should contain every next operation for grabbing the contact photo, such as network requests. Once you have received your image, pass it back to ShortLook by calling resolveWithImage:
on your promise, which is a parameter of your block. If an error occurs and you are not able to fetch a contact photo for the user, call reject
on the promise. Once you’ve resolved or rejected a promise, you may not do so it again, such as to change the image.
161 |
162 |
The promise object also features many properties, such as usesCaching
and backgroundColor
, which can be set at any time before the promise is completed.
163 |
What if I can get my image instantly?
164 |
165 |
If your image is returned instantly, rather than by using a network request, you can use a convenience method on DDNotificationContactPhotoPromiseOffer
, named offerInstantlyResolvingPromiseWithPhotoIdentifier:image:
. Just return the generated promise from your provider. Choose wisely, though. This method should only be used if you can get your image absolutely instantly. If you take too long using this synchronous method, ShortLook may penalize your provider.
166 |
167 |
168 |
169 | Your package should usually be called something like APP Photo Provider for ShortLook in Cydia.
170 | It is recommended you make your bundle name something like ShortLook-APP .
171 |
172 |
Full Documentation
173 |
174 |
You can view the full class documentation for ShortLook’s photo provider API here .
175 |
Examples
176 |
177 |
You can look at the following open source provider examples to get an idea of how to use the ShortLook API:
178 |
179 |
183 |
184 |
185 |
Always-on Screen State Provider
186 |
187 |
Starting in version 1.0.2, ShortLook provides an external coordination API for non-Dynastic tweaks to use. It will allow these tweaks to provide the screen’s display on state, since some tweaks fake the screen being off on OLED phones.
188 |
189 |
If your tweak keeps the screen on while the user would expect it to be off, ShortLook can obey this preference and behave like the screen is off.
190 |
191 |
First, implement the following provider in a class where you wish to provide this information:
192 |
@protocol DDLunarScreenStateProvider < NSObject >
193 | @required
194 | /// If your tweak keeps the screen awake to provide an always-on experience but should act to Lunar like the display is off, return whether you want the screen to be treated as on or off here. If any single provider is returning NO for this, the screen will be treated as such.
195 | - ( BOOL ) isScreenOn ;
196 | @end
197 |
198 |
199 |
Once you have implemented that, you must register an instance of this class using DDLunarScreenStateManager
. You can call registerScreenStateProvider:
on the shared manager to tell ShortLook to ask your provider before deciding how to treat the screen state, using the following header:
200 |
@interface DDLunarScreenStateManager : NSObject
201 | + ( instancetype ) sharedManager ;
202 | - ( void ) registerScreenStateProvider :( NSObject < DDLunarScreenStateProvider > * ) provider ;
203 | - ( void ) deregisterScreenStateProvider :( NSObject < DDLunarScreenStateProvider > * ) provider ;
204 | @end
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
217 |
218 |
219 |
220 |
--------------------------------------------------------------------------------
/docs/js/jazzy.js:
--------------------------------------------------------------------------------
1 | window.jazzy = {'docset': false}
2 | if (typeof window.dash != 'undefined') {
3 | document.documentElement.className += ' dash'
4 | window.jazzy.docset = true
5 | }
6 | if (navigator.userAgent.match(/xcode/i)) {
7 | document.documentElement.className += ' xcode'
8 | window.jazzy.docset = true
9 | }
10 |
11 | function toggleItem($link, $content) {
12 | var animationDuration = 300;
13 | $link.toggleClass('token-open');
14 | $content.slideToggle(animationDuration);
15 | }
16 |
17 | function itemLinkToContent($link) {
18 | return $link.parent().parent().next();
19 | }
20 |
21 | // On doc load + hash-change, open any targetted item
22 | function openCurrentItemIfClosed() {
23 | if (window.jazzy.docset) {
24 | return;
25 | }
26 | var $link = $(`.token[href="${location.hash}"]`);
27 | $content = itemLinkToContent($link);
28 | if ($content.is(':hidden')) {
29 | toggleItem($link, $content);
30 | }
31 | }
32 |
33 | $(openCurrentItemIfClosed);
34 | $(window).on('hashchange', openCurrentItemIfClosed);
35 |
36 | // On item link ('token') click, toggle its discussion
37 | $('.token').on('click', function(event) {
38 | if (window.jazzy.docset) {
39 | return;
40 | }
41 | var $link = $(this);
42 | toggleItem($link, itemLinkToContent($link));
43 |
44 | // Keeps the document from jumping to the hash.
45 | var href = $link.attr('href');
46 | if (history.pushState) {
47 | history.pushState({}, '', href);
48 | } else {
49 | location.hash = href;
50 | }
51 | event.preventDefault();
52 | });
53 |
54 | // Clicks on links to the current, closed, item need to open the item
55 | $("a:not('.token')").on('click', function() {
56 | if (location == this.href) {
57 | openCurrentItemIfClosed();
58 | }
59 | });
60 |
--------------------------------------------------------------------------------
/docs/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | $(function(){
2 | var $typeahead = $('[data-typeahead]');
3 | var $form = $typeahead.parents('form');
4 | var searchURL = $form.attr('action');
5 |
6 | function displayTemplate(result) {
7 | return result.name;
8 | }
9 |
10 | function suggestionTemplate(result) {
11 | var t = '';
12 | t += '' + result.name + ' ';
13 | if (result.parent_name) {
14 | t += '' + result.parent_name + ' ';
15 | }
16 | t += '
';
17 | return t;
18 | }
19 |
20 | $typeahead.one('focus', function() {
21 | $form.addClass('loading');
22 |
23 | $.getJSON(searchURL).then(function(searchData) {
24 | const searchIndex = lunr(function() {
25 | this.ref('url');
26 | this.field('name');
27 | this.field('abstract');
28 | for (const [url, doc] of Object.entries(searchData)) {
29 | this.add({url: url, name: doc.name, abstract: doc.abstract});
30 | }
31 | });
32 |
33 | $typeahead.typeahead(
34 | {
35 | highlight: true,
36 | minLength: 3,
37 | autoselect: true
38 | },
39 | {
40 | limit: 10,
41 | display: displayTemplate,
42 | templates: { suggestion: suggestionTemplate },
43 | source: function(query, sync) {
44 | const lcSearch = query.toLowerCase();
45 | const results = searchIndex.query(function(q) {
46 | q.term(lcSearch, { boost: 100 });
47 | q.term(lcSearch, {
48 | boost: 10,
49 | wildcard: lunr.Query.wildcard.TRAILING
50 | });
51 | }).map(function(result) {
52 | var doc = searchData[result.ref];
53 | doc.url = result.ref;
54 | return doc;
55 | });
56 | sync(results);
57 | }
58 | }
59 | );
60 | $form.removeClass('loading');
61 | $typeahead.trigger('focus');
62 | });
63 | });
64 |
65 | var baseURL = searchURL.slice(0, -"search.json".length);
66 |
67 | $typeahead.on('typeahead:select', function(e, result) {
68 | window.location = baseURL + result.url;
69 | });
70 | });
71 |
--------------------------------------------------------------------------------
/docs/search.json:
--------------------------------------------------------------------------------
1 | {"Protocols/DDNotificationContactPhotoProviding.html#/c:objc(pl)DDNotificationContactPhotoProviding(im)contactPhotoPromiseOfferForNotification:":{"name":"-contactPhotoPromiseOfferForNotification:","abstract":"Returns an offer to fulfill a promise to provide a contact photo for a notification.
","parent_name":"DDNotificationContactPhotoProviding"},"Protocols/DDNotificationContactPhotoProviding.html":{"name":"DDNotificationContactPhotoProviding","abstract":"An object that can provide contact photos for ShortLook notifications.
"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)photoIdentifier":{"name":"photoIdentifier","abstract":"A unique identifier for the photo that will be provided by this promise.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)titleOverride":{"name":"titleOverride","abstract":"A string to replace the notification’s title with, if it is required for your provider’s context. Set to “” to remove the provided notification’s title.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)subtitleOverride":{"name":"subtitleOverride","abstract":"A string to replace the notification’s subtitle with, if it is required for your provider’s context. Set to “” to remove the provided notification’s subtitle.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(py)bodyOverride":{"name":"bodyOverride","abstract":"A string to replace the notification’s body with, if it is required for your provider’s context. Set to “” to remove the provided notification’s body.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(im)initWithPhotoIdentifier:":{"name":"-initWithPhotoIdentifier:","abstract":"Initialize a promise with the provided photo identifier.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerDownloadingPromiseWithPhotoIdentifier:fromURL:":{"name":"+offerDownloadingPromiseWithPhotoIdentifier:fromURL:","abstract":"Create a promise offer that will return the image at the provided URL, if needed.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerDownloadingPromiseWithPhotoIdentifier:fromURL:withSettings:":{"name":"+offerDownloadingPromiseWithPhotoIdentifier:fromURL:withSettings:","abstract":"Create a promise offer that will return the image at the provided URL, if needed, with custom settings.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerInstantlyResolvingPromiseWithPhotoIdentifier:image:":{"name":"+offerInstantlyResolvingPromiseWithPhotoIdentifier:image:","abstract":"Create a promise offer that will instantly return the provided image.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(cm)offerInstantlyResolvingPromiseWithPhotoIdentifier:image:withSettings:":{"name":"+offerInstantlyResolvingPromiseWithPhotoIdentifier:image:withSettings:","abstract":"Create a promise offer that will instantly return the provided image with custom settings.
","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromiseOffer.html#/c:objc(cs)DDNotificationContactPhotoPromiseOffer(im)fulfillWithBlock:":{"name":"-fulfillWithBlock:","abstract":"Add the block that will run if your image is needed (as it will not be in some cases, such as if your image is already cached by ShortLook).","parent_name":"DDNotificationContactPhotoPromiseOffer"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(py)settings":{"name":"settings","abstract":"
An object holding the settings pertaining to the photo to be displayed.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(py)isComplete":{"name":"isComplete","abstract":"Whether or not this promise has already been resolved or rejected.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(im)resolveWithImage:":{"name":"-resolveWithImage:","abstract":"Resolve this promise with the provided image, notifying ShortLook that you have received your image.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoPromise.html#/c:objc(cs)DDNotificationContactPhotoPromise(im)reject":{"name":"-reject","abstract":"Reject this promise, notifying ShortLook that you failed to receive an image.
","parent_name":"DDNotificationContactPhotoPromise"},"Classes/DDNotificationContactPhotoSettings.html#/c:objc(cs)DDNotificationContactPhotoSettings(py)backgroundColor":{"name":"backgroundColor","abstract":"The background colour to show for the contact photo view if the provided image contains any transparency.
","parent_name":"DDNotificationContactPhotoSettings"},"Classes/DDNotificationContactPhotoSettings.html#/c:objc(cs)DDNotificationContactPhotoSettings(py)usesCaching":{"name":"usesCaching","abstract":"Whether or not ShortLook should automatically cache the returned image from your provider and use it for all future notifications with the same photo identifier and application.
","parent_name":"DDNotificationContactPhotoSettings"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(py)notificationTitle":{"name":"notificationTitle","abstract":"A custom notification title, separate from the application’s title.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(py)userInfo":{"name":"userInfo","abstract":"A dictionary of any extra information included by ShortLook.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(py)request":{"name":"request","abstract":"The system notification request that created this notification.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(im)content":{"name":"-content","abstract":"The user notification’s content, sent by the application.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(im)applicationUserInfo":{"name":"-applicationUserInfo","abstract":"A dictionary of any extra information provided by the application sending the notification.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html#/c:objc(cs)DDUserNotification(im)senderIdentifier":{"name":"-senderIdentifier","abstract":"The bundle identifier of the application this notification represents.
","parent_name":"DDUserNotification"},"Classes/DDUserNotification.html":{"name":"DDUserNotification","abstract":"A ShortLook-displayable notification representing a real user notification sent by an application to the system.
"},"Classes/DDNotificationContactPhotoSettings.html":{"name":"DDNotificationContactPhotoSettings","abstract":"An object representing settings for the photo to be provided by a promise.
"},"Classes/DDNotificationContactPhotoPromise.html":{"name":"DDNotificationContactPhotoPromise","abstract":"A promise representing a commitment to providing a contact icon for a notification.
"},"Classes/DDNotificationContactPhotoPromiseOffer.html":{"name":"DDNotificationContactPhotoPromiseOffer","abstract":"An offer to fulfill a promise representing a commitment to providing a contact icon for a notification.
"},"Classes.html":{"name":"Classes","abstract":"The following classes are available globally.
"},"Protocols.html":{"name":"Protocols","abstract":"The following protocols are available globally.
"}}
--------------------------------------------------------------------------------