Ayva.InreachIPC 0.1.3

dotnet add package Ayva.InreachIPC --version 0.1.3
                    
NuGet\Install-Package Ayva.InreachIPC -Version 0.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ayva.InreachIPC" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ayva.InreachIPC" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Ayva.InreachIPC" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ayva.InreachIPC --version 0.1.3
                    
#r "nuget: Ayva.InreachIPC, 0.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ayva.InreachIPC@0.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ayva.InreachIPC&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Ayva.InreachIPC&version=0.1.3
                    
Install as a Cake Tool

InreachIPC

License: Unlicense Build Status NuGet Badge

C# Library to communicate with the InReach Satellite API

Updates

[1/24/2020] v0.1.3 Fix erroneous serialization on subclasses
  • Prevents serialization of private attributes on subclasses where OptIn behavior was not applied.
[1/24/2020] v0.1.2 Proper response deserialization, exception handling, and support for non-attribute uri parameters
  • Breaking change: Services.Send(APIModel) has been renamed to Services.Process(APIModel)
[1/5/2020] v0.1.1 Added a length-check for outbound messages, throws FormatException when overrun.
  • Binary messages are limited to 268 bytes
  • Text messages are limited to 160 chars

Installation

Install-Package Ayva.InreachIPC

Features

Implemented

  • Binary Messages
  • Text Messages
  • API Version Query
  • API Region Selection
  • Exception Handling
  • Response Model Deserialization

Planned

  • Outbound Message Callback
  • Location History
  • Last Known Location
  • Location Request
  • Tracking
  • Emergency Status

Supported Regions

  • InreachIPC.Config.APIEndpoint: [US, Europe, Australia, Custom]

Example

Setup the API
            //Create the API with credentials and optional endpoint
            InreachIPC.Services API = new InreachIPC.Services(username:"user@name", password:"correct horse battery staple!", region: InreachIPC.Config.RegionalEndpoints.US);
Send a version request
            //First create the API model - we'll use VersionModel here
            var APIVersion = new InreachIPC.Messaging.VersionModel();

            //Then send it to InreachIPC.Services to process the request & response.  The model will be populated with the result information, diagnostic information, and the response.
            Console.WriteLine($"Unprocessed APIVersion: {APIVersion}");
            Console.WriteLine($"Processed APIVersion: {await API.Process(APIVersion)}");

            /** Result:
                  New APIVersion: {Model=VersionModel, Path=Messaging.svc/Version, Status=NEW, ID=87207750-1ac1-4459-b4b5-d0641140687e | JSON: "{}"}
                  Processed APIVersion: {Model=VersionModel, Path=Messaging.svc/Version, Status=PROCESSED, ID=87207750-1ac1-4459-b4b5-d0641140687e | JSON: "{"Build":"1.0.37.8399","Service":"Messaging","URL":"https://airdroptracker.com/IPCInbound/V1/Messaging.svc","Version":"V1"}"}
             */

            //There are a few other informational methods implemented on the APIModel type:
            //  Get the JSON-parsed & formatted result
            Console.WriteLine($"Model.GetJsonResult(): {await APIVersion.GetJsonResult()}");
            /** Result:
                  Model.GetJsonResult(): {
                    "Build": "1.0.37.8399",
                    "Service": "Messaging",
                    "URL": "https://airdroptracker.com/IPCInbound/V1/Messaging.svc",
                    "Version": "V1"
                  }
             */

            //  Get the raw result text
            Console.WriteLine($"Model.GetRawResult(): {await APIVersion.GetRawResult()}");
            /** Result:
                  Model.GetRawResult(): {"Build":"1.0.37.8399","Service":"Messaging","URL":"https:\/\/airdroptracker.com\/IPCInbound\/V1\/Messaging.svc","Version":"V1"}
             */
Send a binary/text message
            var DeviceIMEI = 555555555555555;
            var Sender = "5165559817";

            //Binary Message Example
            var binaryMessage = new InreachIPC.Messaging.BinaryMessageModel()
            {
                Messages = new List<InreachIPC.Messaging.BinaryMessageModel.Message>()
                {
                    new InreachIPC.Messaging.BinaryMessageModel.Message()
                    {
                        //Max payload is 268 bytes, recipient is the IMEI
                        Payload = new byte[3]{0x00, 0x01, 0x02},
                        Recipients = {DeviceIMEI},
                        Type = InreachIPC.Messaging.BinaryMessageModel.Message.BinaryTypeModel.Generic
                    }
                }
            };

            //Text Message Example
            var textMessage = new InreachIPC.Messaging.TextMessageModel()
            {
                Messages = new List<InreachIPC.Messaging.TextMessageModel.Message>()
                {
                    new InreachIPC.Messaging.TextMessageModel.Message()
                    {
                        MessageText = "API TextMessage Test",
                        Recipients = {DeviceIMEI},
                        Sender = Sender,
                        Timestamp = DateTime.UtcNow
                    }
                }
            };

            try
            {
                /** Final warning: These cost money/credits on plans without unlimited messaging, and require valid credentials **/
                Console.WriteLine(await API.Process(binaryMessage));
                Console.WriteLine(await API.Process(textMessage));
            }

            catch (InreachIPC.Services.InreachIPCException e)
            {
                Console.WriteLine(e);

                /** Example exception (formatted):
                      Ayva.InreachIPC.Services+InreachIPCException:
                        {
                            Message="API request failed",
                            Code=Forbidden,
                            Response={"Code":3,"Description":"","IMEI":null,"Message":"Invalid username or password","URL":"https:\/\/airdroptracker.com\/IPCInbound\/V1\/Messaging.svc\/Binary"},
                            Model={
                                Type=BinaryMessageModel,
                                Path=Messaging.svc/Binary,
                                Status=ERROR,
                                ID=652a8ad8-ee26-440f-8720-7523b751be86
                                JSON={"Messages":[{"_payload":"AAEC","Recipients":[555555555555555],"Type":1,"Payload":"AAEC"}]}
                              },
                            ServicesEndpoint=US
                        }
                 */
            }

License

Unlicense (Public Domain)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.3 769 1/25/2020
0.1.2 657 1/24/2020
0.1.1 607 1/6/2020
0.1.0 597 10/30/2019