You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 23, 2025. It is now read-only.
Then run `carthage update --platform iOS` or `carthage update --platform Mac`.
60
+
Then run `carthage update --platform iOS --use-xcframeworks` or `carthage update --platform Mac --use-xcframeworks`.
61
+
62
+
You just need to drag and drop `ApolloDeveloperKit.xcframework` to your project.
56
63
57
64
### Swift Package Manager
58
65
@@ -63,67 +70,52 @@ Since Xcode 12 has only limited support for resources installed via Swift Packag
63
70
Setup
64
71
-----
65
72
66
-
First, in order to hook Apollo's cache and network layer, you need to use `DebuggableNetworkTransport` and `DebuggableInMemoryNormalizedCache` instead of usual ones.
73
+
First, you need to declare a long-lived variable where `ApolloDebugServer` belongs to, because as soon as you release the server, it stops running.
67
74
68
-
```swift
69
-
let networkTransport =DebuggableNetworkTransport(networkTransport: HTTPNetworkTransport(url: url))
70
-
let cache =DebuggableInMemoryNormalizedCache()
75
+
The following code assumes you already have a procedure that instantiates `ApolloClient` in `AppDelegate`.
76
+
77
+
```
78
+
class AppDelegate: UIResponder, UIApplicationDelegate {
79
+
private var server: ApolloDebugServer!
80
+
private var client: ApolloClient!
81
+
}
71
82
```
72
83
73
-
Second, instantiate `ApolloStore` and `ApolloClient` with debuggable ingredients.
84
+
In order to hook Apollo's cache and network layer, you need to use `DebuggableRequestChainNetworkTransport` and `DebuggableNormalizedCache` instead of usual `RequestChainNetworkTransport` and `NormalizedCache`.
85
+
86
+
So the second step is to declare `ApolloStore` using `DebuggableNormalizedCache`.
87
+
88
+
Normally it should be put in the beginning of application, like `UIApplication.application(_:didFinishLaunchingWithOptions:)`.
74
89
75
90
```swift
91
+
let cache =DebuggableNormalizedCache(cache: InMemoryNormalizedCache())
76
92
let store =ApolloStore(cache: cache)
77
-
let client =ApolloClient(networkTransport: networkTransport: store: store)
78
93
```
79
94
80
-
Finally, create `ApolloDebugServer` and run.
95
+
Third, configure network layer and instantiate `ApolloClient` with debuggable ingredients.
See `Example/{iOS,macOS}/AppDelegate.swift` for full examples.
111
+
122
112
Usage
123
113
-----
124
114
125
115
**If you don't have [Apollo Client Developer Tools](https://www.apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools), install it before proceeding the following steps.**
126
116
117
+
**Currently `ApolloDeveloperKit` supports only version 2.x of Apollo Client Developer Tools.**
118
+
127
119
1. Launch your app on your device or simulator.
128
120
2. Open your browser and jump to the server's URL (in case your app runs the above example on a simulator, the URL would be `http://localhost:8081`).
129
121
- You will see `ApolloDebugServer is running!` on your browser's tab.
0 commit comments