<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kerim Njuhovic on Medium]]></title>
        <description><![CDATA[Stories by Kerim Njuhovic on Medium]]></description>
        <link>https://medium.com/@kerim-njuhovic?source=rss-54300df5a2b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_EP0nkMuZbX4jUxqzUkA1A.jpeg</url>
            <title>Stories by Kerim Njuhovic on Medium</title>
            <link>https://medium.com/@kerim-njuhovic?source=rss-54300df5a2b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 15:17:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kerim-njuhovic/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Automating TestFlight Feedback: From Crash Reports to GitHub and Jira]]></title>
            <link>https://kerim-njuhovic.medium.com/automating-testflight-feedback-from-crash-reports-to-github-and-jira-6cd4168fbcb8?source=rss-54300df5a2b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cd4168fbcb8</guid>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[testflight]]></category>
            <category><![CDATA[jira]]></category>
            <dc:creator><![CDATA[Kerim Njuhovic]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 10:36:22 GMT</pubDate>
            <atom:updated>2026-10-06T10:36:22.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RVy18uPZUDI6tT_NFMw7KQ.png" /></figure><p><em>Collect beta feedback, create linked issues, and avoid duplicate reports with GitHub Actions &amp; App Store Connect API.</em></p><p>TestFlight collects crash submissions and screenshot feedback in App Store Connect.</p><p>Our team tracks development in GitHub and Jira, so those reports also need to reach both tools. Checking App Store Connect and copying reports manually adds work and makes it easy to miss feedback.</p><p>We automated that process with a Node.js script and a scheduled GitHub Actions workflow.</p><p>This article explains how the script works, how it checks for existing reports, and how to choose a schedule for your own project.</p><h3>What the automation does</h3><p>On each run, the script reads crash submissions and screenshot feedback from the App Store Connect API. For new submissions, it creates a GitHub issue and a Jira ticket, then adds links so developers can move between them.</p><p>Before creating an issue, it checks whether that submission has already been filed.</p><p>It also ignores reports older than a configured start date, so enabling the workflow does not import months of feedback by accident.</p><p>The script runs in GitHub Actions and exits when it finishes. There is no separate server or database to operate.</p><h3>Scheduled checks or webhooks?</h3><p>Apple introduced App Store Connect webhooks at WWDC25. For TestFlight feedback,subscribe to BETA_FEEDBACK_CRASH_SUBMISSION_CREATED andBETA_FEEDBACK_SCREENSHOT_SUBMISSION_CREATED. Webhooks notify a receiver when feedback is submitted, rather than waiting for the next scheduled API check.</p><p>A webhook needs a public HTTPS endpoint. A GitHub Actions job cannot serve as that endpoint. You need a receiver, such as an existing backend, Azure Function, or AWS Lambda. It verifies Apple’s signature and sends a repository_dispatchevent to GitHub to start the workflow.</p><p>We used scheduled checks to keep the setup inside GitHub Actions. The trade-off is that reports wait until the next run. If your team already has a webhook receiver, or needs faster reporting, webhooks may be a better fit.</p><h3>Run once daily</h3><p>The workflow runs once daily at 09:00 UTC. This keeps scheduled runs to about 30 per month and collects new feedback for the team to review each day.</p><p>With this schedule, a submission waits up to 24 hours for the next check,or about 12 hours on average if feedback arrives evenly throughout the day.</p><p>API availability, workflow runtime, and GitHub scheduling delays can add to that wait. Scheduled jobs can start late, so the cron expression is not a delivery guarantee.</p><p>For faster reporting, use the webhook option below. Its backup check also runs once daily.<br>Actions usage depends on the runner, job duration, billing rules, and your plan.</p><p>Do not calculate billed minutes from the script’s runtime alone: checkout and setup also take time, and billable jobs are rounded up to whole minutes. For example, 30 billable jobs lasting less than a minute each would still consume 30 minutes.</p><p>Set the daily schedule in the workflow:</p><pre>on:<br>  schedule:<br>    - cron: &quot;0 9 * * *&quot;<br>  workflow_dispatch: {}</pre><p>The manual trigger is useful for testing once the workflow exists on the default branch.</p><h3>Option 2: Start the workflow with a webhook</h3><p>The implementation described above uses scheduled checks. This section describes an alternative setup; it does not require changing the issue-creation logic.</p><p>The request flow is:</p><pre>Tester submits crash or screenshot feedback<br>  -&gt; App Store Connect sends an HTTPS POST<br>  -&gt; Your receiver verifies the request<br>  -&gt; The receiver sends a repository_dispatch event to GitHub<br>  -&gt; GitHub Actions runs the feedback script<br>  -&gt; The script creates or completes the GitHub and Jira reports</pre><p>This removes the wait for the next cron run. GitHub still needs time to start the job, and the script still needs to read the report from Apple’s API. It is faster triggering, not a guarantee of instant issue creation.</p><h3>1. Deploy a small HTTPS receiver</h3><p>Use your existing backend or a serverless function on a platform your team already operates. Azure Functions, AWS Lambda, and other HTTPS-capable services can all handle this. No particular provider is required.</p><p>The receiver needs a route such as:</p><pre>POST https://automation.example.com/webhooks/app-store-connect</pre><p>Store two separate credentials in the receiver’s secret store:</p><ul><li>A random webhook secret shared with App Store Connect.</li><li>A GitHub credential allowed to send dispatch events to the target repository.</li></ul><p>Prefer a GitHub App installation token for the GitHub request. The dispatch endpoint requires repository <strong>Contents: write</strong> permission. Restrict the App to the intended repository and generate short-lived installation tokens as needed. A fine-grained token with the same repository permission is another option.</p><p>Do not use a developer’s CLI login token as the receiver’s permanent credential. The receiver cannot use the workflow’s GITHUB_TOKEN: that token is available inside a running Actions job, not to an external service.</p><h3>2. Register the webhook with Apple</h3><p>Use an App Store Connect API token with permission to manage webhooks. Send the following configuration to POST <a href="https://api.appstoreconnect.apple.com/v1/webhooks:">https://api.appstoreconnect.apple.com/v1/webhooks:</a></p><pre>{<br>  &quot;data&quot;: {<br>    &quot;type&quot;: &quot;webhooks&quot;,<br>    &quot;attributes&quot;: {<br>      &quot;name&quot;: &quot;TestFlight feedback&quot;,<br>      &quot;enabled&quot;: true,<br>      &quot;url&quot;: &quot;https://automation.example.com/webhooks/app-store-connect&quot;,<br>      &quot;secret&quot;: &quot;REPLACE_WITH_A_RANDOM_SECRET&quot;,<br>      &quot;eventTypes&quot;: [<br>        &quot;BETA_FEEDBACK_CRASH_SUBMISSION_CREATED&quot;,<br>        &quot;BETA_FEEDBACK_SCREENSHOT_SUBMISSION_CREATED&quot;<br>      ]<br>    },<br>    &quot;relationships&quot;: {<br>      &quot;app&quot;: {<br>        &quot;data&quot;: {<br>          &quot;type&quot;: &quot;apps&quot;,<br>          &quot;id&quot;: &quot;YOUR_APP_ID&quot;<br>        }<br>      }<br>    }<br>  }<br>}</pre><p>Use the same webhook secret in Apple’s configuration and the receiver.</p><p>It is separate from the .p8 key used for App Store Connect API authentication.</p><p>Save the returned webhook ID for testing and inspecting deliveries.</p><h3>3. Verify the request before processing it</h3><p>Apple sends an x-apple-signature header in this format:</p><pre>hmacsha256=&lt;hex signature&gt;</pre><p>Calculate HMAC-SHA256 using the shared secret and the original request body. Compare the result with Apple’s signature using a constant-time comparison:</p><pre>import crypto from &quot;node:crypto&quot;;</pre><pre>function verifyAppleSignature(rawBody, signatureHeader, secret) {<br>  if (typeof signatureHeader !== &quot;string&quot;) return false;<br>  const match = /^hmacsha256=([a-fA-F0-9]{64})$/.exec(signatureHeader);<br>  if (!match) return false;</pre><pre>  const expected = crypto<br>    .createHmac(&quot;sha256&quot;, secret)<br>    .update(rawBody)<br>    .digest();<br>  const received = Buffer.from(match[1], &quot;hex&quot;);</pre><pre>  return crypto.timingSafeEqual(expected, received);<br>}</pre><p>Here, rawBody is a Buffer containing the bytes received by the endpoint.</p><p>Read it before a framework’s JSON parser changes the body. Parsing JSON and then serializing it again can change whitespace and make a valid signature fail.</p><p>Reject invalid signatures with an HTTP error and log the rejection without logging credentials or private feedback. Apply request-size limits as well. Only parse and process the JSON after verification succeeds.</p><h3>4. Send a GitHub dispatch event</h3><p>For real feedback notifications, Apple’s payload uses these data.type values:</p><pre>betaFeedbackCrashSubmissionCreated<br>betaFeedbackScreenshotSubmissionCreated</pre><p>The submission ID and resource type are in</p><p>data.relationships.instance.data. The top-level data.id identifies the</p><p>webhook event, not the feedback submission. The simplest receiver checks that the event is one of these types and dispatches the existing script. The script then reads both feedback endpoints as usual.</p><p>This avoids depending on the webhook containing the complete crash report.</p><pre>async function dispatchFeedbackCheck({ repo, token }) {<br>  const response = await fetch(<br>    `https://api.github.com/repos/${repo}/dispatches`,<br>    {<br>      method: &quot;POST&quot;,<br>      headers: {<br>        Authorization: &quot;Bearer &quot; + token,<br>        Accept: &quot;application/vnd.github+json&quot;,<br>        &quot;Content-Type&quot;: &quot;application/json&quot;,<br>        &quot;X-GitHub-Api-Version&quot;: &quot;2022-11-28&quot;,<br>      },<br>      body: JSON.stringify({<br>        event_type: &quot;testflight-feedback&quot;,<br>      }),<br>    }<br>  );</pre><pre>  if (!response.ok) {<br>    throw new Error(`GitHub dispatch failed: ${response.status}`);<br>  }<br>}</pre><p>In the receiver’s HTTP handler, verify the signature, parse the JSON, check the event type, and await this dispatch call. Handle Apple’s test pings separately from real feedback; they should not create issues.</p><p>Return a successful HTTP response only after GitHub accepts the dispatch, or after you have saved the event in a durable queue for later processing.</p><p>Do not start background work in a serverless handler and return before it finishes. If dispatch fails, return an error and record the failure.</p><p>For higher feedback volumes, you can pass a validated submission ID and resource type in client_payload and fetch only that report. That requires a separate processing path and careful handling of queued events. The full-list check is the smaller change for an existing scheduled script.</p><h3>5. Add the workflow trigger</h3><p>Add repository_dispatch alongside the existing triggers:</p><pre>on:<br>  repository_dispatch:<br>    types: [testflight-feedback]<br>  workflow_dispatch: {}<br>  schedule:<br>    - cron: &quot;0 9 * * *&quot;</pre><p>The workflow must exist on the default branch. Keep the same job, environment variables, and script command used by the scheduled version.</p><p>This example keeps a daily check at 09:00 UTC as a backup. It can find missed submissions or complete reports left unfinished by a failed job. Webhook-triggered runs happen when feedback arrives; the scheduled backup runs only once per day.</p><p>A successful dispatch means GitHub accepted the event, not that the Actions job completed. Monitor workflow failures independently. The submission marker and partial-failure handling remain necessary with webhooks.</p><h3>6. Test delivery and recovery</h3><p>Use Apple’s POST /v1/webhookPings endpoint with the saved webhook ID to test reachability and signature handling:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;type&quot;: &quot;webhookPings&quot;,<br>    &quot;relationships&quot;: {<br>      &quot;webhook&quot;: {<br>        &quot;data&quot;: {<br>          &quot;type&quot;: &quot;webhooks&quot;,<br>          &quot;id&quot;: &quot;YOUR_WEBHOOK_ID&quot;<br>        }<br>      }<br>    }<br>  }<br>}</pre><p>A ping tests the receiver; it is not a substitute for a real feedback submission.</p><p>Next, submit TestFlight feedback and confirm the receiver starts the workflow and the script creates linked reports. Test an invalid signature, a failed GitHub dispatch, and delivery of the same notification more than once.</p><p>Inspect delivery history with GET /v1/webhooks/{id}/deliveries and check the corresponding Actions logs. Avoid assuming notifications arrive only once or that every workflow succeeds.</p><p>Apple documents the registration, signatures, pings, and delivery history in <a href="https://developer.apple.com/documentation/appstoreconnectapi/configuring-webhook-notifications">Configuring and parsing webhook notifications</a>.</p><p>The feedback payloads are documented in <a href="https://developer.apple.com/documentation/appstoreconnectapi/webhook-events">Understanding webhook events</a>.</p><h3>How the script checks for existing reports</h3><p>Each API request can return submissions processed by earlier runs. To recognize them, the script includes the App Store Connect submission ID in the GitHub issue body as an HTML comment:</p><pre>&lt;!-- testflight-id:38215501 --&gt;</pre><p>The comment is stored in the body but hidden in the rendered Markdown.</p><p>Before creating another issue, the script searches for that ID. Include closed issues in the lookup: closing a report should not cause it to be recreated.</p><p>This uses GitHub issues to track processed submissions instead of a separate database.</p><p>There are two important limitations to account for:</p><ul><li>GitHub search results can take time to update. Prevent overlapping workflow runs and check recently created issues when needed.</li><li>A GitHub issue can be created successfully while Jira creation fails. A later run must finish the missing Jira step rather than treat the entire submission as complete.</li></ul><p>A submission marker helps avoid duplicates; it is not by itself a guarantee that every step has finished.</p><h3>How the script skips old feedback</h3><p>The first run may find reports the team has already reviewed. SetTESTFLIGHT_FEEDBACK_SINCE to a UTC timestamp, such as 2026-10-06T10:00:00Z, and store it as a GitHub repository variable.</p><p>The script ignores submissions at or before that time. Use an earlier timestamp if you want to import some existing feedback.</p><h3>Full script overview</h3><p>The full script and GitHub Actions workflow are available in this <a href="https://gist.github.com/ModernMantra/bc219f1208b1c016100c06f43abeae69">gist</a>.</p><p>The published workflow runs once daily at 09:00 UTC. Change its cron expression if you prefer a different schedule.</p><p>The script uses Node.js’s built-in crypto module and fetch, without additional packages. Its main work has six steps.</p><p>The examples below show those steps, not a complete copy-and-run script. Configuration, pagination, report formatting, and recovery after partial failures still need to be connected in the full implementation.</p><h3>1. Create an App Store Connect access token</h3><p>App Store Connect uses a JWT signed with the .p8 private key using ES256.</p><p>Apple limits the token lifetime to 20 minutes; this example uses 19.</p><pre>import crypto from &quot;node:crypto&quot;;</pre><pre>function buildAscToken({ keyId, issuerId, privateKey }) {<br>  const now = Math.floor(Date.now() / 1000);<br>  const header = { alg: &quot;ES256&quot;, kid: keyId, typ: &quot;JWT&quot; };<br>  const payload = {<br>    iss: issuerId,<br>    iat: now,<br>    exp: now + 19 * 60,<br>    aud: &quot;appstoreconnect-v1&quot;,<br>  };</pre><pre>  const encode = (value) =&gt;<br>    Buffer.from(JSON.stringify(value)).toString(&quot;base64url&quot;);<br>  const unsigned = `${encode(header)}.${encode(payload)}`;<br>  const signature = crypto<br>    .createSign(&quot;sha256&quot;)<br>    .update(unsigned)<br>    .sign({ key: privateKey, dsaEncoding: &quot;ieee-p1363&quot; })<br>    .toString(&quot;base64url&quot;);</pre><pre>  return `${unsigned}.${signature}`;<br>}</pre><p>The signature format matters: JWT signatures use the raw r and s values. Node’s ieee-p1363 option produces that format.</p><h3>2. Read crash submissions and screenshot feedback</h3><p>Check HTTP responses before using their contents. Otherwise, a failed request could be mistaken for a successful run with no feedback.</p><pre>async function requestJson(url, options) {<br>  const response = await fetch(url, options);<br>  if (!response.ok) {<br>    throw new Error(<br>      `Request failed: ${response.status} ${response.statusText}`<br>    );<br>  }<br>  return response.json();<br>}</pre><pre>async function fetchFeedbackPage(appId, resource, token) {<br>  return requestJson(<br>    `https://api.appstoreconnect.apple.com/v1/apps/${appId}/${resource}`,<br>    { headers: { Authorization: &quot;Bearer &quot; + token } }<br>  );<br>}</pre><pre>const crashPage = await fetchFeedbackPage(<br>  appId, &quot;betaFeedbackCrashSubmissions&quot;, ascToken<br>);<br>const screenshotPage = await fetchFeedbackPage(<br>  appId, &quot;betaFeedbackScreenshotSubmissions&quot;, ascToken<br>);</pre><p>Each response contains submissions in data. Follow links.next until there are no more pages; fetching only the first page can miss reports.</p><p>For crash submissions, retrieve the log text separately:</p><pre>GET /v1/betaFeedbackCrashSubmissions/{id}/crashLog?fields[betaCrashLogs]=logText</pre><p>Use the submission details, crash log, and available screenshot references to build the report body.</p><h3>3. Check the start date and existing issues</h3><p>Validate the configured start date before processing submissions:</p><pre>function isBeforeBaseline(submittedAt, baselineIso) {<br>  const submitted = Date.parse(submittedAt);<br>  const baseline = Date.parse(baselineIso);</pre><pre>  if (!Number.isFinite(submitted) || !Number.isFinite(baseline)) {<br>    throw new Error(&quot;Invalid submission date or feedback start date&quot;);<br>  }<br>  return submitted &lt;= baseline;<br>}</pre><pre>async function alreadyFiled(submissionId, repo, githubToken) {<br>  const marker = `testflight-id:${submissionId}`;<br>  const query = encodeURIComponent(<br>    `repo:${repo} is:issue &quot;${marker}&quot; in:body`<br>  );<br>  const result = await requestJson(<br>    `https://api.github.com/search/issues?q=${query}`,<br>    { headers: { Authorization: &quot;Bearer &quot; + githubToken } }<br>  );<br>  return result.total_count &gt; 0;<br>}</pre><p>The search example identifies an existing report. In the complete flow, also retrieve that issue and check whether its Jira ticket and links are present.</p><h3>4. Create the GitHub issue</h3><p>Include the report details and submission marker:</p><pre>async function createGitHubIssue({<br>  repo, token, title, body, submissionId<br>}) {<br>  return requestJson(`https://api.github.com/repos/${repo}/issues`, {<br>    method: &quot;POST&quot;,<br>    headers: {<br>      Authorization: &quot;Bearer &quot; + token,<br>      &quot;Content-Type&quot;: &quot;application/json&quot;,<br>    },<br>    body: JSON.stringify({<br>      title,<br>      body: `${body}\n\n&lt;!-- testflight-id:${submissionId} --&gt;`,<br>      labels: [&quot;testflight-feedback&quot;],<br>    }),<br>  });<br>}</pre><p>Create the testflight-feedback label in the repository before using it. The workflow’s GITHUB_TOKEN needs issues: write permission.</p><h3>5. Create the Jira ticket and link both reports</h3><p>This Jira Cloud example uses an account email and API token, not a login password.</p><p>The description uses Jira’s document format, called Atlassian Document Format (ADF).</p><pre>async function createJiraIssue({<br>  baseUrl, email, apiToken, projectKey, summary, reportText, githubUrl<br>}) {<br>  const auth = Buffer.from(`${email}:${apiToken}`).toString(&quot;base64&quot;);<br>  const description = {<br>    type: &quot;doc&quot;,<br>    version: 1,<br>    content: [{<br>      type: &quot;paragraph&quot;,<br>      content: [{<br>        type: &quot;text&quot;,<br>        text: `${reportText}\n\nGitHub issue: ${githubUrl}`,<br>      }],<br>    }],<br>  };</pre><pre>  return requestJson(`${baseUrl}/rest/api/3/issue`, {<br>    method: &quot;POST&quot;,<br>    headers: {<br>      Authorization: &quot;Basic &quot; + auth,<br>      &quot;Content-Type&quot;: &quot;application/json&quot;,<br>    },<br>    body: JSON.stringify({<br>      fields: {<br>        project: { key: projectKey },<br>        summary,<br>        description,<br>        issuetype: { name: &quot;Bug&quot; },<br>      },<br>    }),<br>  });<br>}</pre><p>Use the issue type configured in your project. It may be Bug, Defect, oranother type, and your project may require additional custom fields. Check the create-field metadata, then confirm the payload with a test request. After Jira returns the ticket key, update the GitHub issue with the Jira URL. Preserve the submission marker when updating the body.</p><h3>6. Run the steps and handle incomplete reports</h3><p>The overall flow is:</p><pre>Validate configuration<br>Create the App Store Connect token<br>Read every page of crash and screenshot submissions</pre><pre>For each submission:<br>  Skip it if it is older than the configured start date<br>  Find its GitHub issue, or create one if missing<br>  Find its Jira ticket, or create one if missing<br>  Add any missing links between the two</pre><pre>Exit with an error if processing fails</pre><p>The Jira lookup needs a stable reference to the submission or GitHub issue. That lets the next run find an existing ticket if Jira creation succeeded but updating the GitHub issue failed. At the script’s entry point, make errors fail the Actions job:</p><pre>main().catch((error) =&gt; {<br>  console.error(error);<br>  process.exitCode = 1;<br>});</pre><p>Do not report success when an API call failed. Keep credentials out of log output.</p><h3>Set it up in your repository</h3><ol><li>In App Store Connect, open Users and Access, then Integrations, and generate an API key with access to the app and required feedback endpoints. Save its Key ID, Issuer ID, and .p8 private key.</li><li>Create a Jira API token for a dedicated automation account where your organization supports one. Give it permission to create issues in the target project.</li><li>Add repository secrets: ASC_KEY_ID, ASC_ISSUER_ID, ASC_PRIVATE_KEY,<br> ASC_APP_ID, JIRA_BASE_URL, JIRA_EMAIL, JIRA_API_TOKEN, and<br> JIRA_PROJECT_KEY. Store the private key contents as a secret, never in source control.</li><li>Add the repository variable TESTFLIGHT_FEEDBACK_SINCE with your chosen start date.</li><li>Add a workflow that checks out the repository, sets up Node.js, passes configuration through environment variables, and runs the script once daily at 09:00 UTC.</li></ol><p>Use a concurrency group so scheduled and manual runs do not process reports at the same time:</p><pre>permissions:<br>  contents: read<br>  issues: write</pre><pre>concurrency:<br>  group: testflight-feedback<br>  cancel-in-progress: false</pre><p>Scheduled workflows run from the default branch. Merge the workflow there when you are ready to enable it, and inspect the Actions logs after its first run.</p><h3>Test before enabling the schedule</h3><p>Before the workflow is on the default branch, run the script locally with securely supplied credentials. A local run can create real issues, so use a test repository and Jira project where possible.</p><p>Check these cases:</p><ul><li>Old feedback is skipped.</li><li>A new submission creates a GitHub issue and Jira ticket with links in both directions.</li><li>Running the script again does not create another issue or ticket.</li><li>Closing the GitHub issue does not cause it to be recreated.</li><li>A Jira failure is visible, and a later run completes the missing ticket.</li><li>A failure while adding links can be retried without creating another Jira ticket.</li><li>More than one page of feedback is processed.</li></ul><p>Once the workflow exists on the default branch, use the manual trigger to test the Actions environment without waiting for the schedule.</p><h3>The result</h3><p>TestFlight feedback reaches the tools where the team already works, without someone copying each report manually.</p><p>Scheduled checks keep the setup small where Webhooks reduce waiting but require a receiver.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cd4168fbcb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Writing Codable Boilerplate: A Swift Macro That Does It For You]]></title>
            <link>https://kerim-njuhovic.medium.com/stop-writing-codable-boilerplate-a-swift-macro-that-does-it-for-you-da72d4a97963?source=rss-54300df5a2b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/da72d4a97963</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Kerim Njuhovic]]></dc:creator>
            <pubDate>Thu, 19 Feb 2026 23:38:40 GMT</pubDate>
            <atom:updated>2026-02-19T23:38:40.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEPiOMQi0MS9S5idQuxVaw.png" /></figure><p>How I built a decorator-style property wrapper that turns 50 lines of JSON mapping into 3 lines of code</p><p>You know that feeling when you’re staring at yet another CodingKeys enum, manually mapping userName to user_name for the thousandth time, and you think: <em>&quot;There has to be a better way&quot;</em>?</p><h3>The Problem Every Swift Developer Knows</h3><p>You’re building an iOS app. The backend team sends you an API that looks like this:</p><pre>{<br>    &quot;user_id&quot;: &quot;abc123&quot;,<br>    &quot;full_name&quot;: &quot;Jane Smith&quot;,<br>    &quot;email_address&quot;: &quot;jane@example.com&quot;,<br>    &quot;account_balance&quot;: 1250.50<br>}</pre><p>Snake case. Everywhere. Your Swift code? Beautiful camelCase. Time to write some Codable conformance:</p><pre>struct User: Codable {<br>    let userId: String<br>    let fullName: String<br>    let emailAddress: String<br>    let accountBalance: Double<br>    <br>    enum CodingKeys: String, CodingKey {<br>        case userId = &quot;user_id&quot;<br>        case fullName = &quot;full_name&quot;<br>        case emailAddress = &quot;email_address&quot;<br>        case accountBalance = &quot;account_balance&quot;<br>    }<br>}</pre><p>Wait, it gets worse. Now add init(from:) and encode(to:) if you need any custom logic. Suddenly your 4-property struct is <strong>50+ lines</strong> of pure ceremony.</p><h3>What If It Could Be This Simple?</h3><pre>@CustomCodable<br>struct User: Codable {<br>    @CodingKey(&quot;user_id&quot;) let userId: String<br>    @CodingKey(&quot;full_name&quot;) let fullName: String<br>    @CodingKey(&quot;email_address&quot;) let emailAddress: String<br>    let accountBalance: Double  // no annotation? uses &quot;accountBalance&quot;<br>}</pre><p><strong>That’s it.</strong> No CodingKeys enum. No decoder. No encoder. Just clean, readable decorators.</p><p>The entire CodingKeys enum, init(from:), and encode(to:) get generated at compile time. Zero runtime overhead. Type-safe. And if you forget to add a @CodingKey annotation? It just uses the Swift property name as-is.</p><h3>Enter Swift Macros</h3><p>Swift 5.9 introduced macros — compile-time metaprogramming that can generate code based on your code. Think of them as <strong>type-safe code generators</strong> that run during compilation.</p><p>Unlike runtime reflection (which has performance costs) or code generation scripts (which are brittle and require build phase hacks), Swift macros are:</p><ul><li><strong>Compile-time</strong> — zero runtime cost</li><li><strong>Type-safe</strong> — the compiler validates everything</li><li><strong>IDE-integrated</strong> — Xcode shows you the expanded code</li><li><strong>Sandboxed</strong> — can’t access the file system or network</li></ul><p>Perfect for eliminating boilerplate.</p><h3>How @CustomCodable Works</h3><p>The package has two macros working in tandem:</p><h3>1. @CodingKey(“…”) — The Marker</h3><p>This is a <strong>peer macro</strong> that does absolutely nothing at compile time. It’s purely a marker attribute so the compiler accepts the syntax:</p><pre>@attached(peer)<br>public macro CodingKey(_ key: String) = #externalMacro(<br>    module: &quot;CustomCodableMacros&quot;,<br>    type: &quot;CodingKeyMacro&quot;<br>)</pre><p>The real magic happens in the second macro…</p><h3>2. @CustomCodable — The Generator</h3><p>This is a <strong>member macro</strong> that:</p><ul><li>Walks through all stored properties in your struct</li><li>Checks each property for a @CodingKey(&quot;...&quot;) attribute</li><li>Generates three things: CodingKeys enum, init(from:), and encode(to:)</li></ul><p>Here’s the core logic (simplified):</p><pre>public struct CustomCodableMacro: MemberMacro {<br>    public static func expansion(<br>        of node: AttributeSyntax,<br>        providingMembersOf declaration: some DeclGroupSyntax,<br>        in context: some MacroExpansionContext<br>    ) throws -&gt; [DeclSyntax] {<br>        <br>        // 1. Find all stored properties<br>        let storedVars = declaration.memberBlock.members.compactMap { item in<br>            guard let varDecl = item.decl.as(VariableDeclSyntax.self),<br>                  let pattern = binding.pattern.as(IdentifierPatternSyntax.self)<br>            else { return nil }<br>            <br>            let propName = pattern.identifier.text<br>            let jsonKey = extractCodingKey(from: varDecl) ?? propName<br>            <br>            return (propName, jsonKey)<br>        }<br>        <br>        // 2. Generate CodingKeys, init(from:), encode(to:)<br>        return [<br>            generateCodingKeys(from: storedVars),<br>            generateDecoder(from: storedVars),<br>            generateEncoder(from: storedVars)<br>        ]<br>    }<br>}</pre><p>The macro uses Apple’s swift-syntax library to parse the AST (Abstract Syntax Tree) and generate new code as DeclSyntax nodes.</p><h3>What Gets Generated?</h3><p>For this input:</p><pre>@CustomCodable<br>struct MyStruct: Codable {<br>    @CodingKey(&quot;AUsernAme&quot;) let aUserName: String<br>    let creditScore: Int<br>}</pre><p>The macro expands to this at compile time:</p><pre>struct MyStruct: Codable {<br>    let aUserName: String<br>    let creditScore: Int<br>    <br>    enum CodingKeys: String, CodingKey {<br>        case aUserName = &quot;AUsernAme&quot;<br>        case creditScore  // no raw value = uses Swift name<br>    }<br>    <br>    init(from decoder: Decoder) throws {<br>        let container = try decoder.container(keyedBy: CodingKeys.self)<br>        aUserName = try container.decode(String.self, forKey: .aUserName)<br>        creditScore = try container.decode(Int.self, forKey: .creditScore)<br>    }<br>    <br>    func encode(to encoder: Encoder) throws {<br>        var container = encoder.container(keyedBy: CodingKeys.self)<br>        try container.encode(aUserName, forKey: .aUserName)<br>        try container.encode(creditScore, forKey: .creditScore)<br>    }<br>}</pre><p>💡 <strong>Pro tip:</strong> You can actually see this in Xcode by right-clicking on @CustomCodable and choosing &quot;Expand Macro&quot;. It&#39;s like having X-ray vision into your compiler.</p><h3>Before &amp; After in Production</h3><p>I converted a production codebase with 87 Codable structs:</p><ul><li><strong>2,847 lines removed</strong> (CodingKeys enums + manual decoders)</li><li><strong>~65% less boilerplate</strong> per struct</li><li><strong>Zero runtime overhead</strong> — it’s just generated code</li><li><strong>100% compile-time safety</strong> — typos caught immediately</li></ul><h3>Why This Matters</h3><p>Swift macros represent a fundamental shift in how we write Swift:</p><ul><li><strong>Declarative over imperative</strong> — say what you want, not how to get it</li><li><strong>Compile-time guarantees</strong> — catch errors before runtime</li><li><strong>Zero abstraction cost</strong> — no performance penalty</li><li><strong>IDE transparency</strong> — you can always see the generated code</li></ul><p>This isn’t just about saving keystrokes. It’s about writing code that expresses intent, not implementation details.</p><h3>Getting Started</h3><p>The entire package is open source and ready to use:</p><pre>// In Package.swift<br>dependencies: [<br>    .package(url: &quot;https://github.com/ModernMantra/CustomCodable.git&quot;, from: &quot;1.0.0&quot;)<br>]</pre><p><strong>Requirements:</strong> Swift 6.0+, Xcode 16+. The macro system is stable and production-ready.</p><p>Want to dive deeper? Check out the full source code on <a href="https://github.com/ModernMantra/CustomCodable.git">GitHub</a> and let me know what you think!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da72d4a97963" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic screen content made with Table Section Modules in Swift]]></title>
            <link>https://kerim-njuhovic.medium.com/dynamic-screen-content-made-with-table-section-modules-in-swift-f82993ddee8?source=rss-54300df5a2b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f82993ddee8</guid>
            <category><![CDATA[table-view-controller]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[cocoapods]]></category>
            <dc:creator><![CDATA[Kerim Njuhovic]]></dc:creator>
            <pubDate>Wed, 30 Dec 2020 14:27:57 GMT</pubDate>
            <atom:updated>2020-12-30T14:27:57.064Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TvC9VYIHYLlu7cFRYbgvyw.png" /></figure><p>Well, you are probably tired of seeing in your project many implementations of the two protocols: <em>UITableViewDelegate</em> &amp; <em>UITableViewDataSource</em>. What about having only single implementation of the previously mentioned protocols?</p><p>The main idea is to have a screen on iOS Device composed out of modules which you can easily add them, remove them and get bonus auto resize of the screen content.<em> A Module in the implementation is related to a Section in a UITableView which should be able to work for itself independently. </em>Thus, as result in your UIViewController you are dealing with the Modules and its data types, on the other side you are leaving to Module to deal with the low level things such as <em>UITableViewCell </em>and table view protocols implementation<em> </em>stuff.</p><h3>Let’s dive deep</h3><h4>Table Section Module</h4><p>The heart of the implementation idea represents the class which will implement <em>UITableViewDelegate</em> &amp; <em>UITableViewDataSource</em>. In addition, the class will have initialiser dependency injection on the main table view property from your <em>UIViewController.<br></em>For now it will be omitted but in your <em>TableSectionModule</em> you can add various types of boilerplate code related to the table view: code for calculation for needed height and resizing of cells in case you add or remove module, auto register cells and so on. The rough implementation looks like following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/877b03161af60c053434abd5474a94f6/href">https://medium.com/media/877b03161af60c053434abd5474a94f6/href</a></iframe><h4>Sample Module</h4><p>Now, lets use the previously created <em>TableSectionModule. </em>We will create our sample module which will inherit from <em>TableSectionModule</em> and override what is needed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/554c0cbc03f189f86146550b4bb9e12b/href">https://medium.com/media/554c0cbc03f189f86146550b4bb9e12b/href</a></iframe><h4>Let’s glue it all together</h4><p>In the ViewController where the table view reference is located we can simply append the modules to the table view. No more <em>UITableViewDelegate</em> and <em>UITableViewDataSource</em> boilerplate code 💫.</p><p>And now, final result:</p><pre>let sampleModule = SampleModule(tableView: self.baseTableView!) <br>self.appendModule(firstModule)</pre><p>There already exists some ready solutions published as Third Party libraries to be integrated via CocoaPods. Some of them are <a href="https://github.com/fjtrujy/TableSectionModules">TableSectionModules</a> and <a href="https://cocoapods.org/pods/FTMTableSectionModules">FTMTableSectionModule</a>. In essence, they are all implementation of the idea published in this article with some difference based on boilerplate code extracted. Now, it is up to you whether you have time for custom implementation or easy integration of existing library.</p><p>Happy Coding 🍀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f82993ddee8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Register & Maintain the UITableViewCell in an easy way]]></title>
            <link>https://kerim-njuhovic.medium.com/register-maintain-the-uitableviewcell-in-an-easy-way-2d6e622f6c2d?source=rss-54300df5a2b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d6e622f6c2d</guid>
            <category><![CDATA[swift-4]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Kerim Njuhovic]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 19:21:46 GMT</pubDate>
            <atom:updated>2018-11-14T19:21:46.338Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGk78jdKQi7joswVRWBFCQ.png" /></figure><p>One liner code is not good in the most of the cases, I agree, but for those who likes it, here is one of them. So, the old school way would require from you firstly to create UINib object and to load it, afterwards registering it in table view. In short</p><pre>let nib = UINib(nibName: &quot;nameOfYourNibFile&quot;, bundle: nil)<br>tableView.register(register: nib, forCellReuseIdentifier: &quot;yourIdentifier&quot;)</pre><p>Now, in case you have multiple types of cells, it can easily grow up. What you think about this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/546159010a05ba8e689c9bca4aa4c3bc/href">https://medium.com/media/546159010a05ba8e689c9bca4aa4c3bc/href</a></iframe><p>No more strings manipulation and remembering name of nib, nor cell reuse identifier. Additionaly, in case you add any new cells they get atomatically registered. So, let’s go…</p><p>You will need to create simple protocol which will conform itself to <em>CaseIterable </em>(it is type which provides a collection of all of its values, more info about <a href="https://developer.apple.com/documentation/swift/caseiterable">it</a>), which gives us easily accessible <strong>allValues</strong>. Our protcol should contain simple property of type <strong>AnyClass </strong>(represeting our UITableViewCell or CollectionViewCell). All in all</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75e6031203f95b2781c99726cb3e74a7/href">https://medium.com/media/75e6031203f95b2781c99726cb3e74a7/href</a></iframe><p>So, let us consider you have home screen with multiple cell types to be loaded. Let’s create enumeration conforming to protocol created previously.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9539b3a60766f01077532eef158de7ea/href">https://medium.com/media/9539b3a60766f01077532eef158de7ea/href</a></iframe><p>Now, final step is to extend functionalities of <em>UITableView</em> by creating the extension. The old school way with a bit of modifications 😊</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f53920c18cf54b06bfa9a9a780d5fe9b/href">https://medium.com/media/f53920c18cf54b06bfa9a9a780d5fe9b/href</a></iframe><p>Not that much complicated as it may seem. I hope i will get those One-Liner haters 😀. If you like it, don’t forget to give small applause, will appreciate it. Happy coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d6e622f6c2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NSLog — Devil Behind It]]></title>
            <link>https://kerim-njuhovic.medium.com/nslog-devil-behind-it-d5a514d73f35?source=rss-54300df5a2b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5a514d73f35</guid>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Kerim Njuhovic]]></dc:creator>
            <pubDate>Thu, 05 Jul 2018 22:41:51 GMT</pubDate>
            <atom:updated>2018-07-05T22:41:51.862Z</atom:updated>
            <content:encoded><![CDATA[<p>NSLog is a great and most common iOS developer tool that is used to debug apps. It can be used to check network requests and its responses, check value of the variables or log any notes you need.</p><p>Even though it is handy tool, it is far away from being perfect. Some of the downsides:</p><ul><li>it is slow, in other words it is synchronous. Try to log one big string 😈, it might lead to app crash because of the main thread being blocked</li><li>no log levels, it is difficult to differentiate between warning, error or simple debug information</li><li>no remote access, it works only when you have physical device attached</li></ul><p>Overall, it is not bad, right!? But, what if I say that NSLog might lead to data leakage? 😱</p><p>NSLog does not only print the log information to Xcode console, but also sends the message to global system log (i.e. ASL, more information about Apple System Log you can find <a href="https://developer.apple.com/documentation/os/logging">here</a>). ASL offers ability to make queries to search existing data (unfortunately, it is deprecated as from macOS 10.12). In general, NSLog represents fusion of the <em>syslog</em> and <em>printf</em>. Data logged through NSLog could be retrieved by anyone who is in posession of physical device.</p><p>Data logged through NSLog remain on the device until it is rebooted. Furthermore, logs are not bounded with application sandbox, which means that logs can be read between the apps. 😈</p><p>So, without any tricks, connect your iOS device and open Xcode. Go to Window &gt; Devices and Simulators &gt; View Device Logs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TZvpDls_kNLKiloiPq4S2w.png" /></figure><p>What is even more “scary” is that you could read ASL for any app from your device programatically. There are even few paid application out there on the AppStore which offers reading the logs from the device.</p><p>With some looking around the web and playing with C language code, the result is here — printing all the logs coming from<em> Xcode</em> application (you can insert the name of the app you want to look for logs, instead of <em>“Xcode”)</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/221c7425ef4bb692478879e653f4cb0b/href">https://medium.com/media/221c7425ef4bb692478879e653f4cb0b/href</a></iframe><p>So, in order to avoid some future hackers to possibly steal the confident information from your app, you can disable the NSLog for production builds but still enjoy in log informations while you develop 😎.</p><ul><li>Step 1 (create *.pch file)</li></ul><p>If you do not have already <em>.pch</em> file, go to File &gt; New File &gt; PCH File (under the section Others)</p><blockquote>PCH file is Pre-Compiled Header file. It stands there for making compiling faster. Instead of parsing the file over and over it gets parsed once, ahead of time.</blockquote><ul><li>Step 2 (defining PCH for project)</li></ul><p>Go to Project Settings &gt; Build settings. Search for prefix header and add following line</p><p>$(SRCROOT)/$(PRODUCT_NAME)/&lt;nameOfFile&gt;.pch</p><p><strong>$(SRCROOT)</strong> — stands for the path of your Xcode project<br><strong>$(PRODUCT_NAME)</strong> — name of the folder of your project.</p><ul><li>Step 3 (redefening NSLog)</li></ul><p>Add in your .pch file following</p><pre>#ifndef DEBUG<br>#define NSLog(...)<br>#endif</pre><p>In case the DEBUG flag is undefined in release mode, it will be redefined as nothing to be run. Xcode by default defines the DEBUG flag for debug build (check this by going to Project Settings &gt; Build Settings tab &gt; <strong>Preprocessor Macros</strong> and verify you see the DEBUG=1 is only set for Debug mode.</p><p>So, be careful next time and use NSLog with caution balancing between how often you log the info and whether you will need that logged data. Or at least, disable it on your release app. Happy coding 🐵</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5a514d73f35" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>