Skip to content

Commit

Permalink
feat(listen) adding listen feature (#521)
Browse files Browse the repository at this point in the history
* fix(conflict): weird conflict when adding listen

* feat(listen): creating listen service

* feat(listen): lauching listen on user screen

* feat(listen): adding in listen launching

* fix(display): standardizing saveditem display logic

* feat(listen): adding listen view model and protocol conformance

* feat(listen): cleaning up models

* feat(listen): rename runtime so namespace is free

* feat(listen): some listen cleanup

* feat(listen): moving to built in runtime that we can extend

* feat(listen): adding filter for items

* fix(listen): updating listen network

* feat(listen): cleaning up supported items

* feat(listen): base analytics for listen

* fix(runtime): using the obj runtime

* feat(listen): adding listen xcframework

* fix(builds): adding back mac support

* fix(listen): ensuring tests have new word count property

* feat(listen): wired up archive and save

* chore(tests): updating localization

* fix(listen): merge develop

* feat(listen): add listen behind a feature flag
  • Loading branch information
bassrock committed Apr 11, 2023
1 parent 2e22386 commit 62db3f7
Show file tree
Hide file tree
Showing 807 changed files with 63,876 additions and 5,733 deletions.
Binary file added PKTListenResources.bundle/Assets.car
Binary file not shown.
Binary file added PKTListenResources.bundle/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
113 changes: 113 additions & 0 deletions PKTListenResources.bundle/_CodeSignature/CodeResources
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Assets.car</key>
<data>
LlwMalR/AEkToD30JxkBpDr1HL0=
</data>
</dict>
<key>files2</key>
<dict>
<key>Assets.car</key>
<dict>
<key>hash</key>
<data>
LlwMalR/AEkToD30JxkBpDr1HL0=
</data>
<key>hash2</key>
<data>
o5qgiVDB/+KJTJ0tyJkEeFGE50tnB5zTNUJ6mzsO49Q=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
Binary file not shown.
4 changes: 4 additions & 0 deletions Pocket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
658140EA29A5993C00346848 /* SnowplowMicro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658140E929A5993C00346848 /* SnowplowMicro.swift */; };
658140EC29A59A0C00346848 /* HTTPDataDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658140EB29A59A0C00346848 /* HTTPDataDownloader.swift */; };
65BE918E29A5B9AF00B13BF1 /* AnyCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BE918D29A5B9AF00B13BF1 /* AnyCodable.swift */; };
65D3105229CEACF100952D64 /* PKTListenResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 65D3105129CEACEE00952D64 /* PKTListenResources.bundle */; };
65EC272728BA8AD50075E1DF /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65EC272628BA8AD50075E1DF /* UserNotifications.framework */; };
65EC272928BA8AD50075E1DF /* UserNotificationsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65EC272828BA8AD50075E1DF /* UserNotificationsUI.framework */; };
65EC272C28BA8AD50075E1DF /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EC272B28BA8AD50075E1DF /* NotificationViewController.swift */; };
Expand Down Expand Up @@ -226,6 +227,7 @@
658140E929A5993C00346848 /* SnowplowMicro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnowplowMicro.swift; sourceTree = "<group>"; };
658140EB29A59A0C00346848 /* HTTPDataDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPDataDownloader.swift; sourceTree = "<group>"; };
65BE918D29A5B9AF00B13BF1 /* AnyCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnyCodable.swift; sourceTree = "<group>"; };
65D3105129CEACEE00952D64 /* PKTListenResources.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = PKTListenResources.bundle; sourceTree = "<group>"; };
65EC272528BA8AD50075E1DF /* PushNotificationStoryExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = PushNotificationStoryExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
65EC272628BA8AD50075E1DF /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
65EC272828BA8AD50075E1DF /* UserNotificationsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotificationsUI.framework; path = System/Library/Frameworks/UserNotificationsUI.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -333,6 +335,7 @@
166A81A32637406B0015AA1D = {
isa = PBXGroup;
children = (
65D3105129CEACEE00952D64 /* PKTListenResources.bundle */,
653DA73829C3BC1500123847 /* Pocket_iOS_Release.entitlements */,
653DA73729C3BC0A00123847 /* Pocket_iOS_Debug.entitlements */,
653DA73629C3BC0200123847 /* Pocket_iOS_Debug_AlphaNeue.entitlements */,
Expand Down Expand Up @@ -705,6 +708,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
65D3105229CEACF100952D64 /* PKTListenResources.bundle in Resources */,
16E32B0226851AEB000CC36D /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "45167b8006448c79dda4b7bd604e07a034c15c49",
"version" : "2.48.0"
"revision" : "9b2848d76f5caad08b97e71a04345aa5bdb23a06",
"version" : "2.49.0"
}
},
{
Expand Down
44 changes: 44 additions & 0 deletions PocketKit/Frameworks/PKTListen.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libPKTListen.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libPKTListen.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// APIRequestGate.h
// RIL
//
// Created by Steve Streza on 8/13/12.
//
// Used if you need an interstitial step before making API requests.

#import <Foundation/Foundation.h>

@class PKTAPIRequest;

NS_ASSUME_NONNULL_BEGIN

@interface APIRequestGate : NSObject

@property (atomic, strong, readonly) NSMutableArray *pendingRequests;

- (void)addPendingRequest:(PKTAPIRequest *)request;
- (void)startPendingRequests;

// implement these in subclasses
- (BOOL)canPerformRequest:(PKTAPIRequest *)request;
- (void)processGate;
- (BOOL)checkForRequest:(PKTAPIRequest *)request;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// AVSpeechSynthesisVoice+Listen.h
// Listen
//
// Created by David Skuza on 2/8/19.
// Copyright © 2019 PKT. All rights reserved.
//

@import AVFoundation;

NS_ASSUME_NONNULL_BEGIN

/**
An AVSpeechSynthesisVoice caterogy that contains helper methods for tasks related to Listen settings.
*/
@interface AVSpeechSynthesisVoice (Listen)

/**
@return An array of all available system voices sorted alphabetically (ascending).
*/
+ (NSArray<AVSpeechSynthesisVoice *> *)sortedVoices;

/**
The first voice matching the user's current system language after being sorted alphabetically (ascending).
@return An AVSpeechSynthesisVoice for the user's current language.
*/
+ (AVSpeechSynthesisVoice *)firstVoiceForCurrentLanguage;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Action+ScreenSize.h
// PKTRuntime
//
// Created by David Skuza on 12/26/18.
// Copyright © 2018 Pocket. All rights reserved.
//

#import "Action.h"

UIKIT_EXTERN NSString *const PKTLastKnownScreenSizeActionKey;

@interface Action (ScreenSize)

/**
The action to send for the current screen size, or nil if no new action has to be sent.
@return If the current screen size has not yet been sent, an action will be returned.
@return If the current screen size has already been sent, nil will be returned.
@return If the current screen size has been changed, but the session is the same, nil will be returned.
@return If the current screen size has been changed, and the session is different, an action will be returned.
*/
+ (instancetype)actionForCurrentScreenSize;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// Action.h
// RIL
//
// Created by Nate Weiner on 10/18/11.
// Copyright (c) 2011 Pocket All rights reserved.
//

@import Foundation;

#import "PKTSharedEnums.h"

@class PKTItem;

NS_ASSUME_NONNULL_BEGIN

@interface Action : NSObject

@property (nonatomic, strong) NSDictionary *dictionary;
@property (nonatomic, assign, getter = actionId) ActionId actionId;

+ (instancetype)fromDictionary:(NSDictionary *)dictionary;
+ (instancetype)action:(NSString *)action;
+ (instancetype)action:(NSString *)action data:(NSDictionary * _Nullable)data;
+ (instancetype)action:(NSString *)action data:(NSDictionary * _Nullable)data context:(NSDictionary * _Nullable)context;
+ (instancetype)action:(NSString *)action uniqueId:(NSNumber *)uniqueId
itemId:(NSNumber * _Nullable)itemId;

+ (instancetype)action:(NSString *)action
uniqueId:(NSNumber *)uniqueId
itemId:(NSNumber * _Nullable)itemId
data:(NSDictionary * _Nullable)data
context:(NSDictionary * _Nullable)context;

- (instancetype)initWithAction:(NSString *)action
uniqueId:(NSNumber *)uniqueId
itemId:(NSNumber *_Nullable)itemId
data:(NSDictionary * _Nullable)data
context:(NSDictionary * _Nullable)context;

- (id)attr:(NSString *)key;
- (void)setObject:(id)object forKey:(id)aKey;

- (NSDictionary *)JSONString;

- (void)commitAction;
- (void)commitDelayedAction;

@end

NS_ASSUME_NONNULL_END

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// ActionStore.h
// PKTRuntime
//
// Created by David Skuza on 12/26/18.
// Copyright © 2018 Pocket. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class Action;

@protocol ActionStore <NSObject>

/**
Stores an action for a given key.
@param action The action to store.
@param key The key to map the action to.
*/
- (void)setAction:(Action *)action forKey:(NSString *)key;

/**
Returns a stored action for a given key.
@param key The key to which an action is mapped.
@return The stored action, or nil if one does not exist for a given key.
*/
- (Action *_Nullable)actionForKey:(NSString *)key;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 62db3f7

Please sign in to comment.