This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <os/signpost.h> | |
| // We need to specify a subsystem | |
| #define SUBSYSTEM "de.apptects.signposts" | |
| // Categories helps us structuring the data in Instruments | |
| #define CATEGORY_ASSETLOADING "Asset Loading" | |
| #define CATEGORY_INPUT "Input" | |
| // Interval names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define os_signpost_event_emit(log, event_id, name, ...) | |
| #define os_signpost_interval_begin(log, interval_id, name, ...) | |
| #define os_signpost_interval_end(log, interval_id, name, ...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Runtime.InteropServices; | |
| public static class Signposts | |
| { | |
| [DllImport ("__Internal")] | |
| private static extern void initialize_log_handles(); | |
| [DllImport("__Internal")] | |
| public static extern ulong start_interval_load_asset(string _assetPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private IEnumerator LoadSpriteAsync(string _assetName) | |
| { | |
| var sid = Signposts.start_interval_load_asset(_assetName); | |
| var request = Resources.LoadAsync<Sprite>(_assetName); | |
| yield return request; | |
| Signposts.stop_interval_load_asset(sid); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func readReceipt() -> (Receipt: Data, IsSandbox: Bool) { | |
| let receiptURL = Bundle.main.appStoreReceiptURL! | |
| // We are running in sandbox when receipt URL ends with 'sandboxReceipt' | |
| let isSandbox = receiptURL.absoluteString.hasSuffix("sandboxReceipt") | |
| let receiptData = try! Data(contentsOf: receiptURL) | |
| return(receiptData, isSandbox) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct ReceiptData: Codable { | |
| let receipt: String | |
| let sandbox: Bool | |
| } | |
| struct AppStoreValidationResult: Codable { | |
| let status: Int | |
| let environment: String | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "fmt" | |
| "github.com/gorilla/mux" | |
| "log" | |
| "net/http" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies: | |
| flutter: | |
| sdk: flutter | |
| flutter_redux: ^0.5.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Store<AppState> store; | |
| void main() { | |
| store = Store<AppState>( | |
| reducer, | |
| initialState: AppState.initial(), | |
| middleware: [thunkMiddleware] | |
| ); | |
| runApp(FlutteriTunesApp(store)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AppState reducer(AppState oldState, dynamic action) { | |
| if(action is ChangeSearchTextAction) { | |
| return oldState.copyWith(searchText: action.searchText); | |
| } else if (action is UpdateTrackItemsAction) { | |
| return oldState.copyWith(trackItems: action.trackItems); | |
| } else if (action is PlayAudioUrlAction) { | |
| return oldState.copyWith(activePlayingAudioUrl: action.audioUrl); | |
| } else if (action is StopAudioAction) { | |
| return oldState.copyWith(activePlayingAudioUrl: ''); |
OlderNewer