Use internal when exposing low-level types like IntPtr
@ryzngard is already working on this.
Since May 5, 2026.
Assessment
This issue has not been assessed yet.
Description
Is your feature request related to a problem? Please describe.
No, this is about hardening the API.
Exposing low-level types like IntPtr as public in user-facing code is bad practice for an interop library like this. It causes excessive, unnecessary information and APIs being exposed to users, which could lead to confusion and error-prone code being made with it.
Describe the solution you'd like
Refactor client-facing low-level members, constructors, etc. to be internal (or protected internal if necessary). For example, NSArray<T> has a public constructor with an IntPtr parameter. Users do not need to know about this, and makes the API messier for those trying to simply interface with it. Using an AssemblyInfo.cs can allow internal members to be available to other Apple assemblies without having to expose unnecessary data to users.
Describe alternatives you've considered
There are none.
Additional context
https://docs.unity3d.com/2020.1/Documentation/Manual/ScriptCompilationAssemblyDefinitionFiles.html
Example AssemblyInfo.cs file:
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Apple.Core.Tests")]
- Dominant language
- C#
- Stars
- 986
- Forks
- 252
- Avg merge
- 1h 36m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apple/unityplugins
-
bug Plug-in - GameKit
apple/unityplugins#98 · 2 comments · 1 assignee ·
-
feature request
apple/unityplugins#94 · 3 comments · 8 reactions · 1 assignee ·
-
feature request Plug-in - GameKit
Difficulty 5/5 Over a week Newbie friendliness 45/100
apple/unityplugins#93 · 1 reaction ·
-
bug Plug-in - GameKit
apple/unityplugins#92 · 1 reaction · 1 assignee ·
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 35/100
apple/unityplugins#86 · 3 reactions ·
All issues in apple/unityplugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightscout/nocturne#1379 ·
-
priority-0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
StackExchange/StackExchange.Redis#3249 ·
-
[Feat] 조합 영역 구분선 개선 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100