mrousavy / mrousavy/react-native-nitro-image

How to use Nitro Image in nitro module library?

Open
#127 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
652
Forks
37
Avg merge
56m
Merged PRs (30d)
6

Description

I'm having trouble using nitro image in another nitro module. I've followed the instructions here and have successfully used NitroImage in android, but on iOS when trying to implement HybridImageSpec, xcode is giving the following error:

Type 'HybridUIImage' cannot conform to protocol 'HybridImageSpec_protocol' because it has requirements that cannot be satisfied

Here is the implementation (this is ripped straight from react-native-vision-camera).

import AVFoundation
import Foundation
import NitroImage
import NitroModules

internal final class HybridUIImage: HybridImageSpec, NativeImage {
  let uiImage: UIImage
  init(uiImage: UIImage) {
    self.uiImage = uiImage
  }
}

Did I miss a step/config? Any help would be much appreciated.

versions being used:

"react-native-nitro-image": "^0.14.0",
"react-native-nitro-modules": "^0.35.6",

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the third-party integration instructions with the HybridImageSpec and NativeImage implementation shown in the issue, using the reported react-native-nitro-image and react-native-nitro-modules versions. Reproduce the iOS Xcode conformance error and inspect the protocol requirements. Done means HybridUIImage conforms successfully and the Nitro image integration builds on iOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, swift, typescript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.