├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── question-query-template.md
├── PULL_REQUEST_TEMPLATE.md
├── dependabot.yml
└── icons
│ ├── aznh-icon-128x128.png
│ └── aznh-icon-512x512.png
├── .gitignore
├── CODE_OF_CONDUCT.md
├── LICENSE
├── NuGet.config
├── README.md
├── SECURITY.md
├── azure-pipelines.yml
├── samples
├── NotificationHubSample.Android
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── MainActivity.cs
│ ├── NotificationHubSample.Android.csproj
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ └── Resources
│ │ ├── AboutResources.txt
│ │ ├── Resource.designer.cs
│ │ ├── layout
│ │ ├── Tabbar.xml
│ │ └── Toolbar.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── icon.xml
│ │ └── icon_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-mdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-xhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-xxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ │ └── values
│ │ ├── colors.xml
│ │ └── styles.xml
├── NotificationHubSample.iOS
│ ├── AppDelegate.cs
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon1024.png
│ │ │ ├── Icon120.png
│ │ │ ├── Icon152.png
│ │ │ ├── Icon167.png
│ │ │ ├── Icon180.png
│ │ │ ├── Icon20.png
│ │ │ ├── Icon29.png
│ │ │ ├── Icon40.png
│ │ │ ├── Icon58.png
│ │ │ ├── Icon60.png
│ │ │ ├── Icon76.png
│ │ │ ├── Icon80.png
│ │ │ └── Icon87.png
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.cs
│ ├── NotificationHubSample.iOS.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Resources
│ │ ├── Default-568h@2x.png
│ │ ├── Default-Portrait.png
│ │ ├── Default-Portrait@2x.png
│ │ ├── Default.png
│ │ ├── Default@2x.png
│ │ └── LaunchScreen.storyboard
├── NotificationHubSample.sln
├── NotificationHubSample
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── Constants.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ └── NotificationHubSample.csproj
├── README.md
└── bindings
│ ├── NHubSampleXamarinAndroid
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── InstallationEnrichmentVisitor.cs
│ ├── InstallationSaveFailedListener.cs
│ ├── InstallationSavedListener.cs
│ ├── MainActivity.cs
│ ├── NHubSampleXamarinAndroid.csproj
│ ├── NHubSampleXamarinAndroid.sln
│ ├── NotificationListener.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── Resource.designer.cs
│ │ ├── layout
│ │ │ ├── activity_main.xml
│ │ │ └── content_main.xml
│ │ ├── menu
│ │ │ └── menu_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ └── SampleInstallationAdapter.cs
│ └── NHubSampleXamariniOS
│ ├── AppDelegate.cs
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon1024.png
│ │ ├── Icon120.png
│ │ ├── Icon152.png
│ │ ├── Icon167.png
│ │ ├── Icon180.png
│ │ ├── Icon20.png
│ │ ├── Icon29.png
│ │ ├── Icon40.png
│ │ ├── Icon58.png
│ │ ├── Icon60.png
│ │ ├── Icon76.png
│ │ ├── Icon80.png
│ │ └── Icon87.png
│ ├── DevSettings.plist
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── InstallationEnrichmentDelegate.cs
│ ├── InstallationLifecycleDelegate.cs
│ ├── InstallationManagementDelegate.cs
│ ├── LaunchScreen.storyboard
│ ├── Main.cs
│ ├── Main.storyboard
│ ├── NHubSampleXamariniOS.csproj
│ ├── NHubSampleXamariniOS.sln
│ ├── NotificationDelegate.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Resources
│ └── LaunchScreen.xib
│ ├── SceneDelegate.cs
│ ├── ViewController.cs
│ └── ViewController.designer.cs
└── src
├── Microsoft.Azure.NotificationHubs.Client.sln
├── Microsoft.Azure.NotificationHubs.Client
├── IInstallationEnrichmentAdapter.shared.cs
├── IInstallationManagementAdapter.shared.cs
├── Installation.shared.cs
├── InstallationSaveFailedEventArgs.shared.cs
├── InstallationSavedEventArgs.shared.cs
├── InstallationTemplate.shared.cs
├── Microsoft.Azure.NotificationHubs.Client.csproj
├── NotificationHub.android.cs
├── NotificationHub.ios.cs
├── NotificationHub.net.cs
├── NotificationHub.shared.cs
├── NotificationHubMessageDelegate.ios.cs
├── NotificationListener.android.cs
└── NotificationMessageReceivedEventArgs.shared.cs
└── bindings
├── Android
└── Xamarin.Azure.NotificationHubs.Android
│ ├── Additions
│ └── AboutAdditions.txt
│ ├── Jars
│ └── AboutJars.txt
│ ├── Transforms
│ ├── EnumFields.xml
│ ├── EnumMethods.xml
│ └── Metadata.xml
│ ├── Xamarin.Azure.NotificationHubs.Android.csproj
│ └── Xamarin.Azure.NotificationHubs.Android.sln
├── External-Dependency-Info.txt
├── build.cake
├── cgmanifest.json
└── iOS
└── Xamarin.Azure.NotificationHubs.iOS
├── ApiDefinition.cs
├── StructsAndEnums.cs
├── Xamarin.Azure.NotificationHubs.iOS.csproj
└── Xamarin.Azure.NotificationHubs.iOS.sln
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[BUG]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | ***Exception or Stack Trace***
14 | Add the exception log and stack trace if available
15 |
16 | **To Reproduce**
17 | Steps to reproduce the behavior:
18 |
19 | ***Code Snippet***
20 | Add the code snippet that causes the issue.
21 |
22 | **Expected behavior**
23 | A clear and concise description of what you expected to happen.
24 |
25 | **Screenshots**
26 | If applicable, add screenshots to help explain your problem.
27 |
28 | **Setup (please complete the following information):**
29 | - OS: [e.g. iOS 13.x]
30 | - IDE : [e.g. Visual Studio 2019]
31 | - Version of the Library used
32 |
33 | **Additional context**
34 | Add any other context about the problem here.
35 |
36 | **Information Checklist**
37 | Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
38 | - [ ] Bug Description Added
39 | - [ ] Repro Steps Added
40 | - [ ] Setup information Added
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "[FEATURE REQ]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
22 | **Information Checklist**
23 | Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
24 | - [ ] Description Added
25 | - [ ] Expected solution specified
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question-query-template.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question/Query template
3 | about: Use this template to file a question/query for the SDK team
4 | title: "[QUERY]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Query/Question**
11 | A clear and concise ask/query.
12 |
13 | ***Why is this not a Bug or a feature Request?***
14 | A clear explanation of why is this not a bug or a feature request?
15 |
16 | **Setup (please complete the following information if applicable):**
17 | - OS: [e.g. iOS 13.x]
18 | - IDE : [e.g. Visual Studio 2019]
19 | - Version of the Library used
20 |
21 | **Information Checklist**
22 | Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
23 | - [ ] Query Added
24 | - [ ] Setup information Added
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
9 |
10 | Things to consider before you submit the PR:
11 |
12 | * [ ] Are tests passing locally?
13 | * [ ] Are the files formatted correctly?
14 | * [ ] Did you add unit tests?
15 | * [ ] Did you test your change with either the sample apps that are included in the repository or with a blank app that uses your change?
16 |
17 | ## Description
18 |
19 | A few sentences describing the overall goals of the pull request.
20 |
21 | ## Related PRs or issues
22 |
23 | List related PRs and other issues.
24 |
25 | ## Misc
26 |
27 | Add what's missing, notes on what you tested, additional thoughts or questions.
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "nuget" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "daily"
12 |
--------------------------------------------------------------------------------
/.github/icons/aznh-icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/.github/icons/aznh-icon-128x128.png
--------------------------------------------------------------------------------
/.github/icons/aznh-icon-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/.github/icons/aznh-icon-512x512.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # General
2 | .DS_Store
3 | .AppleDouble
4 | .LSOverride
5 |
6 | # Icon must end with two \r
7 | Icon
8 |
9 |
10 | # Thumbnails
11 | ._*
12 |
13 | # Files that might appear in the root of a volume
14 | .DocumentRevisions-V100
15 | .fseventsd
16 | .Spotlight-V100
17 | .TemporaryItems
18 | .Trashes
19 | .VolumeIcon.icns
20 | .com.apple.timemachine.donotpresent
21 |
22 | # Directories potentially created on remote AFP share
23 | .AppleDB
24 | .AppleDesktop
25 | Network Trash Folder
26 | Temporary Items
27 | .apdisk
28 |
29 | # Windows thumbnail cache files
30 | Thumbs.db
31 | Thumbs.db:encryptable
32 | ehthumbs.db
33 | ehthumbs_vista.db
34 |
35 | # Dump file
36 | *.stackdump
37 |
38 | # Folder config file
39 | [Dd]esktop.ini
40 |
41 | # Recycle Bin used on file shares
42 | $RECYCLE.BIN/
43 |
44 | # Windows Installer files
45 | *.cab
46 | *.msi
47 | *.msix
48 | *.msm
49 | *.msp
50 |
51 | # Windows shortcuts
52 | *.lnk
53 |
54 | ## Ignore Visual Studio temporary files, build results, and
55 | ## files generated by popular Visual Studio add-ons.
56 | ##
57 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
58 |
59 | # User-specific files
60 | *.rsuser
61 | *.suo
62 | *.user
63 | *.userosscache
64 | *.sln.docstates
65 |
66 | # User-specific files (MonoDevelop/Xamarin Studio)
67 | *.userprefs
68 |
69 | # Mono auto generated files
70 | mono_crash.*
71 |
72 | # Build results
73 | [Dd]ebug/
74 | [Dd]ebugPublic/
75 | [Rr]elease/
76 | [Rr]eleases/
77 | x64/
78 | x86/
79 | [Aa][Rr][Mm]/
80 | [Aa][Rr][Mm]64/
81 | bld/
82 | [Bb]in/
83 | [Oo]bj/
84 | [Ll]og/
85 | [Ll]ogs/
86 |
87 | # Visual Studio 2015/2017 cache/options directory
88 | .vs/
89 | # Uncomment if you have tasks that create the project's static files in wwwroot
90 | #wwwroot/
91 |
92 | # Visual Studio 2017 auto generated files
93 | Generated\ Files/
94 |
95 | # MSTest test Results
96 | [Tt]est[Rr]esult*/
97 | [Bb]uild[Ll]og.*
98 |
99 | # NUnit
100 | *.VisualState.xml
101 | TestResult.xml
102 | nunit-*.xml
103 |
104 | # Build Results of an ATL Project
105 | [Dd]ebugPS/
106 | [Rr]eleasePS/
107 | dlldata.c
108 |
109 | # Benchmark Results
110 | BenchmarkDotNet.Artifacts/
111 |
112 | # .NET Core
113 | project.lock.json
114 | project.fragment.lock.json
115 | artifacts/
116 |
117 | # StyleCop
118 | StyleCopReport.xml
119 |
120 | # Files built by Visual Studio
121 | *_i.c
122 | *_p.c
123 | *_h.h
124 | *.ilk
125 | *.meta
126 | *.obj
127 | *.iobj
128 | *.pch
129 | *.pdb
130 | *.ipdb
131 | *.pgc
132 | *.pgd
133 | *.rsp
134 | *.sbr
135 | *.tlb
136 | *.tli
137 | *.tlh
138 | *.tmp
139 | *.tmp_proj
140 | *_wpftmp.csproj
141 | *.log
142 | *.vspscc
143 | *.vssscc
144 | .builds
145 | *.pidb
146 | *.svclog
147 | *.scc
148 |
149 | # Chutzpah Test files
150 | _Chutzpah*
151 |
152 | # Visual C++ cache files
153 | ipch/
154 | *.aps
155 | *.ncb
156 | *.opendb
157 | *.opensdf
158 | *.sdf
159 | *.cachefile
160 | *.VC.db
161 | *.VC.VC.opendb
162 |
163 | # Visual Studio profiler
164 | *.psess
165 | *.vsp
166 | *.vspx
167 | *.sap
168 |
169 | # Visual Studio Trace Files
170 | *.e2e
171 |
172 | # TFS 2012 Local Workspace
173 | $tf/
174 |
175 | # Guidance Automation Toolkit
176 | *.gpState
177 |
178 | # ReSharper is a .NET coding add-in
179 | _ReSharper*/
180 | *.[Rr]e[Ss]harper
181 | *.DotSettings.user
182 |
183 | # TeamCity is a build add-in
184 | _TeamCity*
185 |
186 | # DotCover is a Code Coverage Tool
187 | *.dotCover
188 |
189 | # AxoCover is a Code Coverage Tool
190 | .axoCover/*
191 | !.axoCover/settings.json
192 |
193 | # Visual Studio code coverage results
194 | *.coverage
195 | *.coveragexml
196 |
197 | # NCrunch
198 | _NCrunch_*
199 | .*crunch*.local.xml
200 | nCrunchTemp_*
201 |
202 | # MightyMoose
203 | *.mm.*
204 | AutoTest.Net/
205 |
206 | # Web workbench (sass)
207 | .sass-cache/
208 |
209 | # Installshield output folder
210 | [Ee]xpress/
211 |
212 | # DocProject is a documentation generator add-in
213 | DocProject/buildhelp/
214 | DocProject/Help/*.HxT
215 | DocProject/Help/*.HxC
216 | DocProject/Help/*.hhc
217 | DocProject/Help/*.hhk
218 | DocProject/Help/*.hhp
219 | DocProject/Help/Html2
220 | DocProject/Help/html
221 |
222 | # Click-Once directory
223 | publish/
224 |
225 | # Publish Web Output
226 | *.[Pp]ublish.xml
227 | *.azurePubxml
228 | # Note: Comment the next line if you want to checkin your web deploy settings,
229 | # but database connection strings (with potential passwords) will be unencrypted
230 | *.pubxml
231 | *.publishproj
232 |
233 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
234 | # checkin your Azure Web App publish settings, but sensitive information contained
235 | # in these scripts will be unencrypted
236 | PublishScripts/
237 |
238 | # NuGet Packages
239 | *.nupkg
240 | # NuGet Symbol Packages
241 | *.snupkg
242 | # The packages folder can be ignored because of Package Restore
243 | **/[Pp]ackages/*
244 | # except build/, which is used as an MSBuild target.
245 | !**/[Pp]ackages/build/
246 | # Uncomment if necessary however generally it will be regenerated when needed
247 | #!**/[Pp]ackages/repositories.config
248 | # NuGet v3's project.json files produces more ignorable files
249 | *.nuget.props
250 | *.nuget.targets
251 |
252 | # Microsoft Azure Build Output
253 | csx/
254 | *.build.csdef
255 |
256 | # Microsoft Azure Emulator
257 | ecf/
258 | rcf/
259 |
260 | # Windows Store app package directories and files
261 | AppPackages/
262 | BundleArtifacts/
263 | Package.StoreAssociation.xml
264 | _pkginfo.txt
265 | *.appx
266 | *.appxbundle
267 | *.appxupload
268 |
269 | # Visual Studio cache files
270 | # files ending in .cache can be ignored
271 | *.[Cc]ache
272 | # but keep track of directories ending in .cache
273 | !?*.[Cc]ache/
274 |
275 | # Others
276 | ClientBin/
277 | ~$*
278 | *~
279 | *.dbmdl
280 | *.dbproj.schemaview
281 | *.jfm
282 | *.pfx
283 | *.publishsettings
284 | orleans.codegen.cs
285 |
286 | # Including strong name files can present a security risk
287 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
288 | #*.snk
289 |
290 | # Since there are multiple workflows, uncomment next line to ignore bower_components
291 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
292 | #bower_components/
293 |
294 | # RIA/Silverlight projects
295 | Generated_Code/
296 |
297 | # Backup & report files from converting an old project file
298 | # to a newer Visual Studio version. Backup files are not needed,
299 | # because we have git ;-)
300 | _UpgradeReport_Files/
301 | Backup*/
302 | UpgradeLog*.XML
303 | UpgradeLog*.htm
304 | ServiceFabricBackup/
305 | *.rptproj.bak
306 |
307 | # SQL Server files
308 | *.mdf
309 | *.ldf
310 | *.ndf
311 |
312 | # Business Intelligence projects
313 | *.rdl.data
314 | *.bim.layout
315 | *.bim_*.settings
316 | *.rptproj.rsuser
317 | *- [Bb]ackup.rdl
318 | *- [Bb]ackup ([0-9]).rdl
319 | *- [Bb]ackup ([0-9][0-9]).rdl
320 |
321 | # Microsoft Fakes
322 | FakesAssemblies/
323 |
324 | # GhostDoc plugin setting file
325 | *.GhostDoc.xml
326 |
327 | # Node.js Tools for Visual Studio
328 | .ntvs_analysis.dat
329 | node_modules/
330 |
331 | # Visual Studio 6 build log
332 | *.plg
333 |
334 | # Visual Studio 6 workspace options file
335 | *.opt
336 |
337 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
338 | *.vbw
339 |
340 | # Visual Studio LightSwitch build output
341 | **/*.HTMLClient/GeneratedArtifacts
342 | **/*.DesktopClient/GeneratedArtifacts
343 | **/*.DesktopClient/ModelManifest.xml
344 | **/*.Server/GeneratedArtifacts
345 | **/*.Server/ModelManifest.xml
346 | _Pvt_Extensions
347 |
348 | # Paket dependency manager
349 | .paket/paket.exe
350 | paket-files/
351 |
352 | # FAKE - F# Make
353 | .fake/
354 |
355 | # CodeRush personal settings
356 | .cr/personal
357 |
358 | # Python Tools for Visual Studio (PTVS)
359 | __pycache__/
360 | *.pyc
361 |
362 | # Cake - Uncomment if you are using it
363 | # tools/**
364 | # !tools/packages.config
365 |
366 | # Tabs Studio
367 | *.tss
368 |
369 | # Telerik's JustMock configuration file
370 | *.jmconfig
371 |
372 | # BizTalk build output
373 | *.btp.cs
374 | *.btm.cs
375 | *.odx.cs
376 | *.xsd.cs
377 |
378 | # OpenCover UI analysis results
379 | OpenCover/
380 |
381 | # Azure Stream Analytics local run output
382 | ASALocalRun/
383 |
384 | # MSBuild Binary and Structured Log
385 | *.binlog
386 |
387 | # NVidia Nsight GPU debugger configuration file
388 | *.nvuser
389 |
390 | # MFractors (Xamarin productivity tool) working folder
391 | .mfractor/
392 |
393 | # Local History for Visual Studio
394 | .localhistory/
395 |
396 | # BeatPulse healthcheck temp database
397 | healthchecksdb
398 |
399 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
400 | MigrationBackup/
401 |
402 | # Ionide (cross platform F# VS Code tools) working folder
403 | .ionide/
404 |
405 | # Secret Files
406 | google-services.json
407 |
408 | # Rest of Bindings
409 | externals
410 | output
411 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40 |
41 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 |
2 | using Android.App;
3 | using Android.Content.PM;
4 | using Android.Runtime;
5 | using Android.OS;
6 |
7 | namespace NotificationHubSample.Droid
8 | {
9 | [Activity(Label = "NotificationHubSample", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
10 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
11 | {
12 | protected override void OnCreate(Bundle savedInstanceState)
13 | {
14 | TabLayoutResource = Resource.Layout.Tabbar;
15 | ToolbarResource = Resource.Layout.Toolbar;
16 |
17 | base.OnCreate(savedInstanceState);
18 |
19 | Xamarin.Essentials.Platform.Init(this, savedInstanceState);
20 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
21 | LoadApplication(new App());
22 | }
23 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
24 | {
25 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
26 |
27 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/NotificationHubSample.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | {c9e5eea5-ca05-42a1-839b-61506e0a37df}
9 | Library
10 | NotificationHubSample.Droid
11 | NotificationHubSample.Android
12 | True
13 | True
14 | Resources\Resource.designer.cs
15 | Resource
16 | Properties\AndroidManifest.xml
17 | Resources
18 | Assets
19 | v10.0
20 | true
21 | true
22 | Xamarin.Android.Net.AndroidClientHandler
23 |
24 |
25 |
26 |
27 | true
28 | portable
29 | false
30 | bin\Debug
31 | DEBUG;
32 | prompt
33 | 4
34 | None
35 |
36 |
37 | true
38 | portable
39 | true
40 | bin\Release
41 | prompt
42 | 4
43 | true
44 | false
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 | {0661DE01-DD76-4027-96F4-60CAF19362DC}
96 | NotificationHubSample
97 |
98 |
99 | {B7753626-34C8-4981-828B-75D7282C51C2}
100 | Microsoft.Azure.NotificationHubs.Client
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("NotificationHubSample.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("NotificationHubSample.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | [assembly: AssemblyVersion("1.0.0.0")]
26 | [assembly: AssemblyFileVersion("1.0.0.0")]
27 |
28 | // Add some common permissions, these can be removed if not needed
29 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
30 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
31 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/Resource.designer.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable 1591
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | [assembly: global::Android.Runtime.ResourceDesignerAttribute("NotificationHubSample.Droid.Resource", IsApplication=true)]
12 |
13 | namespace NotificationHubSample.Droid
14 | {
15 |
16 |
17 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.99.123")]
18 | public partial class Resource
19 | {
20 |
21 | static Resource()
22 | {
23 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
24 | }
25 |
26 | public static void UpdateIdValues()
27 | {
28 | global::Microsoft.Azure.NotificationHubs.Client.Resource.Drawable.ic_launcher = global::NotificationHubSample.Droid.Resource.Drawable.ic_launcher;
29 | global::Microsoft.Azure.NotificationHubs.Client.Resource.Integer.google_play_services_version = global::NotificationHubSample.Droid.Resource.Integer.google_play_services_version;
30 | global::Microsoft.Azure.NotificationHubs.Client.Resource.String.app_name = global::NotificationHubSample.Droid.Resource.String.app_name;
31 | global::Microsoft.Azure.NotificationHubs.Client.Resource.String.common_google_play_services_unknown_issue = global::NotificationHubSample.Droid.Resource.String.common_google_play_services_unknown_issue;
32 | global::Microsoft.Azure.NotificationHubs.Client.Resource.String.fcm_fallback_notification_channel_label = global::NotificationHubSample.Droid.Resource.String.fcm_fallback_notification_channel_label;
33 | global::Microsoft.Azure.NotificationHubs.Client.Resource.String.firebase_preference_file_key = global::NotificationHubSample.Droid.Resource.String.firebase_preference_file_key;
34 | global::Microsoft.Azure.NotificationHubs.Client.Resource.String.installation_enrichment_file_key = global::NotificationHubSample.Droid.Resource.String.installation_enrichment_file_key;
35 | }
36 |
37 | public partial class Attribute
38 | {
39 |
40 | static Attribute()
41 | {
42 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
43 | }
44 |
45 | private Attribute()
46 | {
47 | }
48 | }
49 |
50 | public partial class Color
51 | {
52 |
53 | // aapt resource value: 0x7F010000
54 | public const int colorAccent = 2130771968;
55 |
56 | // aapt resource value: 0x7F010001
57 | public const int colorPrimary = 2130771969;
58 |
59 | // aapt resource value: 0x7F010002
60 | public const int colorPrimaryDark = 2130771970;
61 |
62 | // aapt resource value: 0x7F010003
63 | public const int launcher_background = 2130771971;
64 |
65 | static Color()
66 | {
67 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
68 | }
69 |
70 | private Color()
71 | {
72 | }
73 | }
74 |
75 | public partial class Drawable
76 | {
77 |
78 | // aapt resource value: 0x7F020000
79 | public const int ic_launcher = 2130837504;
80 |
81 | static Drawable()
82 | {
83 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
84 | }
85 |
86 | private Drawable()
87 | {
88 | }
89 | }
90 |
91 | public partial class Id
92 | {
93 |
94 | // aapt resource value: 0x7F030000
95 | public const int APP_NAME = 2130903040;
96 |
97 | // aapt resource value: 0x7F030001
98 | public const int app_name = 2130903041;
99 |
100 | // aapt resource value: 0x7F030002
101 | public const int sliding_tabs = 2130903042;
102 |
103 | // aapt resource value: 0x7F030003
104 | public const int toolbar = 2130903043;
105 |
106 | static Id()
107 | {
108 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
109 | }
110 |
111 | private Id()
112 | {
113 | }
114 | }
115 |
116 | public partial class Integer
117 | {
118 |
119 | // aapt resource value: 0x7F040000
120 | public const int google_play_services_version = 2130968576;
121 |
122 | static Integer()
123 | {
124 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
125 | }
126 |
127 | private Integer()
128 | {
129 | }
130 | }
131 |
132 | public partial class Layout
133 | {
134 |
135 | // aapt resource value: 0x7F050000
136 | public const int Tabbar = 2131034112;
137 |
138 | // aapt resource value: 0x7F050001
139 | public const int Toolbar = 2131034113;
140 |
141 | static Layout()
142 | {
143 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
144 | }
145 |
146 | private Layout()
147 | {
148 | }
149 | }
150 |
151 | public partial class Mipmap
152 | {
153 |
154 | // aapt resource value: 0x7F060000
155 | public const int icon = 2131099648;
156 |
157 | // aapt resource value: 0x7F060001
158 | public const int icon_round = 2131099649;
159 |
160 | // aapt resource value: 0x7F060002
161 | public const int launcher_foreground = 2131099650;
162 |
163 | static Mipmap()
164 | {
165 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
166 | }
167 |
168 | private Mipmap()
169 | {
170 | }
171 | }
172 |
173 | public partial class String
174 | {
175 |
176 | // aapt resource value: 0x7F070000
177 | public const int app_name = 2131165184;
178 |
179 | // aapt resource value: 0x7F070001
180 | public const int common_google_play_services_unknown_issue = 2131165185;
181 |
182 | // aapt resource value: 0x7F070002
183 | public const int fcm_fallback_notification_channel_label = 2131165186;
184 |
185 | // aapt resource value: 0x7F070003
186 | public const int firebase_preference_file_key = 2131165187;
187 |
188 | // aapt resource value: 0x7F070004
189 | public const int installation_enrichment_file_key = 2131165188;
190 |
191 | static String()
192 | {
193 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
194 | }
195 |
196 | private String()
197 | {
198 | }
199 | }
200 |
201 | public partial class Style
202 | {
203 |
204 | // aapt resource value: 0x7F080000
205 | public const int AppCompatDialogStyle = 2131230720;
206 |
207 | // aapt resource value: 0x7F080001
208 | public const int MainTheme = 2131230721;
209 |
210 | // aapt resource value: 0x7F080002
211 | public const int MainTheme_Base = 2131230722;
212 |
213 | static Style()
214 | {
215 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
216 | }
217 |
218 | private Style()
219 | {
220 | }
221 | }
222 | }
223 | }
224 | #pragma warning restore 1591
225 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/layout/Tabbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/layout/Toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-hdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-hdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-mdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-mdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
24 |
27 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace NotificationHubSample.iOS
9 | {
10 | // The UIApplicationDelegate for the application. This class is responsible for launching the
11 | // User Interface of the application, as well as listening (and optionally responding) to
12 | // application events from iOS.
13 | [Register("AppDelegate")]
14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
15 | {
16 | //
17 | // This method is invoked when the application has loaded and is ready to run. In this
18 | // method you should instantiate the window, load the UI into it and then make the window
19 | // visible.
20 | //
21 | // You have 17 seconds to return from this method, or iOS will terminate your application.
22 | //
23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
24 | {
25 | global::Xamarin.Forms.Forms.Init();
26 | LoadApplication(new App());
27 |
28 | return base.FinishedLaunching(app, options);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | development
7 |
8 |
9 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 9.0
25 | CFBundleDisplayName
26 | NotificationHubSample
27 | CFBundleIdentifier
28 | com.microsoft.NotificationHubSample
29 | CFBundleVersion
30 | 1.0
31 | UILaunchStoryboardName
32 | LaunchScreen
33 | CFBundleName
34 | NotificationHubSample
35 | XSAppIconAssets
36 | Assets.xcassets/AppIcon.appiconset
37 | UIBackgroundModes
38 |
39 | remote-notification
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace NotificationHubSample.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, typeof(AppDelegate));
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/NotificationHubSample.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | {6143fdea-f3c2-4a09-aafa-6e230626515e}
11 | Exe
12 | NotificationHubSample.iOS
13 | Resources
14 | NotificationHubSample.iOS
15 | true
16 | NSUrlSessionHandler
17 | automatic
18 |
19 |
20 | true
21 | full
22 | false
23 | bin\iPhoneSimulator\Debug
24 | DEBUG
25 | prompt
26 | 4
27 | x86_64
28 | None
29 | true
30 |
31 |
32 | none
33 | true
34 | bin\iPhoneSimulator\Release
35 | prompt
36 | 4
37 | None
38 | x86_64
39 |
40 |
41 | true
42 | full
43 | false
44 | bin\iPhone\Debug
45 | DEBUG
46 | prompt
47 | 4
48 | ARM64
49 | iPhone Developer
50 | true
51 | Entitlements.plist
52 | None
53 | -all
54 |
55 |
56 | none
57 | true
58 | bin\iPhone\Release
59 | prompt
60 | 4
61 | ARM64
62 | iPhone Developer
63 | Entitlements.plist
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | false
76 |
77 |
78 | false
79 |
80 |
81 | false
82 |
83 |
84 | false
85 |
86 |
87 | false
88 |
89 |
90 | false
91 |
92 |
93 | false
94 |
95 |
96 | false
97 |
98 |
99 | false
100 |
101 |
102 | false
103 |
104 |
105 | false
106 |
107 |
108 | false
109 |
110 |
111 | false
112 |
113 |
114 | false
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | {0661DE01-DD76-4027-96F4-60CAF19362DC}
132 | NotificationHubSample
133 |
134 |
135 | {B7753626-34C8-4981-828B-75D7282C51C2}
136 | Microsoft.Azure.NotificationHubs.Client
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NotificationHubSample.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NotificationHubSample.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/NotificationHubSample.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/samples/NotificationHubSample.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio Version 16
3 | VisualStudioVersion = 16.0.30204.135
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.NotificationHubs.Client", "..\src\Microsoft.Azure.NotificationHubs.Client\Microsoft.Azure.NotificationHubs.Client.csproj", "{B7753626-34C8-4981-828B-75D7282C51C2}"
6 | EndProject
7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotificationHubSample.Android", "NotificationHubSample.Android\NotificationHubSample.Android.csproj", "{083F45FF-F7EC-4E50-B279-A81A9B1246FB}"
8 | EndProject
9 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotificationHubSample.iOS", "NotificationHubSample.iOS\NotificationHubSample.iOS.csproj", "{0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}"
10 | EndProject
11 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotificationHubSample", "NotificationHubSample\NotificationHubSample.csproj", "{0661DE01-DD76-4027-96F4-60CAF19362DC}"
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Debug|anycpu = Debug|anycpu
17 | Debug|iPhone = Debug|iPhone
18 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
19 | Release|Any CPU = Release|Any CPU
20 | Release|anycpu = Release|anycpu
21 | Release|iPhone = Release|iPhone
22 | Release|iPhoneSimulator = Release|iPhoneSimulator
23 | EndGlobalSection
24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
25 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|anycpu.ActiveCfg = Debug|Any CPU
28 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|anycpu.Build.0 = Debug|Any CPU
29 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|iPhone.ActiveCfg = Debug|Any CPU
30 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|iPhone.Build.0 = Debug|Any CPU
31 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
32 | {B7753626-34C8-4981-828B-75D7282C51C2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
33 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
34 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|Any CPU.Build.0 = Release|Any CPU
35 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|anycpu.ActiveCfg = Release|Any CPU
36 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|anycpu.Build.0 = Release|Any CPU
37 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|iPhone.ActiveCfg = Release|Any CPU
38 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|iPhone.Build.0 = Release|Any CPU
39 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
40 | {B7753626-34C8-4981-828B-75D7282C51C2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
41 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
43 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
44 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|anycpu.ActiveCfg = Debug|Any CPU
45 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|anycpu.Build.0 = Debug|Any CPU
46 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
47 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|iPhone.Build.0 = Debug|Any CPU
48 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
49 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
50 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|Any CPU.Build.0 = Release|Any CPU
52 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|anycpu.ActiveCfg = Release|Any CPU
53 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|anycpu.Build.0 = Release|Any CPU
54 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|iPhone.ActiveCfg = Release|Any CPU
55 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|iPhone.Build.0 = Release|Any CPU
56 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
57 | {083F45FF-F7EC-4E50-B279-A81A9B1246FB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
58 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
59 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
60 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|anycpu.ActiveCfg = Debug|iPhoneSimulator
61 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|anycpu.Build.0 = Debug|iPhoneSimulator
62 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|iPhone.ActiveCfg = Debug|iPhone
63 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|iPhone.Build.0 = Debug|iPhone
64 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
65 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
66 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
67 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
68 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|anycpu.ActiveCfg = Release|iPhoneSimulator
69 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|anycpu.Build.0 = Release|iPhoneSimulator
70 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|iPhone.ActiveCfg = Release|iPhone
71 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|iPhone.Build.0 = Release|iPhone
72 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
73 | {0DE139B0-F9D1-4D3F-9B58-D7AD9C07BCA9}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
74 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
76 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|anycpu.ActiveCfg = Debug|Any CPU
77 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|anycpu.Build.0 = Debug|Any CPU
78 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
79 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|iPhone.Build.0 = Debug|Any CPU
80 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
81 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
82 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
83 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|Any CPU.Build.0 = Release|Any CPU
84 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|anycpu.ActiveCfg = Release|Any CPU
85 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|anycpu.Build.0 = Release|Any CPU
86 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|iPhone.ActiveCfg = Release|Any CPU
87 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|iPhone.Build.0 = Release|Any CPU
88 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
89 | {0661DE01-DD76-4027-96F4-60CAF19362DC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
90 | EndGlobalSection
91 | GlobalSection(SolutionProperties) = preSolution
92 | HideSolutionNode = FALSE
93 | EndGlobalSection
94 | GlobalSection(ExtensibilityGlobals) = postSolution
95 | SolutionGuid = {B813118B-21CC-46F5-89AB-F6717C9C3C4D}
96 | EndGlobalSection
97 | EndGlobal
98 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 |
5 | namespace NotificationHubSample
6 | {
7 | public partial class App : Application
8 | {
9 | public App()
10 | {
11 | InitializeComponent();
12 |
13 | MainPage = new MainPage();
14 | }
15 |
16 | protected override void OnStart()
17 | {
18 | }
19 |
20 | protected override void OnSleep()
21 | {
22 | }
23 |
24 | protected override void OnResume()
25 | {
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms.Xaml;
2 |
3 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
--------------------------------------------------------------------------------
/samples/NotificationHubSample/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace NotificationHubSample
2 | {
3 | public static class Constants
4 | {
5 | public static string ConnectionString = "Endpoint=sb://xamarinforms-matthewp-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=oz/3QRQJqtu6veNzwk+udvicxoHwdHsQ1PxQcOQor2U=";
6 | public static string HubName = "xamarinforms-matthewp-hub";
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using Xamarin.Forms;
4 | using Microsoft.Azure.NotificationHubs.Client;
5 |
6 | namespace NotificationHubSample
7 | {
8 | // Learn more about making custom code visible in the Xamarin.Forms previewer
9 | // by visiting https://aka.ms/xamarinforms-previewer
10 | [DesignTimeVisible(false)]
11 | public partial class MainPage : ContentPage
12 | {
13 |
14 | public MainPage()
15 | {
16 | InitializeComponent();
17 |
18 | // Add a handler for receiving push notifications
19 | NotificationHub.NotificationMessageReceived += OnNotificationMessageReceived;
20 |
21 | // Add handlers for save and save failed for installations
22 | NotificationHub.InstallationSaved += OnInstallatedSaved;
23 | NotificationHub.InstallationSaveFailed += OnInstallationSaveFailed;
24 |
25 | // Create Notification Hub
26 | NotificationHub.Start(Constants.ConnectionString, Constants.HubName);
27 |
28 | // Add a tag
29 | NotificationHub.AddTag("platform_XamarinForms");
30 | }
31 |
32 | private void OnInstallationSaveFailed(object sender, InstallationSaveFailedEventArgs e)
33 | {
34 | Console.WriteLine($"Failed to save installation: {e.Exception.Message}");
35 | }
36 |
37 | private void OnInstallatedSaved(object sender, InstallationSavedEventArgs e)
38 | {
39 | Console.WriteLine($"Installation ID: {e.Installation.InstallationId} saved successfully");
40 | }
41 |
42 | private void OnNotificationMessageReceived(object sender, NotificationMessageReceivedEventArgs e)
43 | {
44 | // Write the message contents
45 | Console.WriteLine(e.Title);
46 | Console.WriteLine(e.Body);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/samples/NotificationHubSample/NotificationHubSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | true
6 |
7 |
8 |
9 | portable
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/samples/README.md:
--------------------------------------------------------------------------------
1 | # Sample applications for Azure Notification Hubs SDK for Xamarin
2 |
3 | This directory contains the sample applications for the following:
4 |
5 | - [Xamarin.Forms](NotificationHubSample)
6 | - [Xamarin.iOS](bindings/NHubSampleXamariniOS)
7 | - [Xamarin.Android](bindings/NHubSampleXamarinAndroid)
8 |
9 | ## Xamarin Forms
10 |
11 | The [Xamarin.Forms](NotificationHubSample) uses the `Microsoft.Azure.NotificationHubs.Client` source project to create a cross platform implementation using Azure Notification Hubs. This sample provides support for both iOS and Android. This sample only needs code in the main NotificationHubSample project to start the SDK and listen for messages.
12 |
13 | In the `MainPage.xaml` file, you can initialize the Azure Notification Hubs using the followingc code to listen for messages, set up installation lifecycle management, and to initialize the SDK with the Access Policy connection string and hub name.
14 |
15 | ```csharp
16 | using Microsoft.Azure.NotificationHubs.Client;
17 |
18 | public class MainPage
19 | {
20 | public MainPage()
21 | {
22 | InitializeComponent();
23 |
24 | // Listen for messages
25 | NotificationHub.NotificationMessageReceived += OnNotificationMessageReceived;
26 |
27 | // Listen for installation save updates/failures
28 | NotificationHub.InstallationSaved += OnInstallatedSaved;
29 | NotificationHub.InstallationSaveFailed += OnInstallationSaveFailed;
30 |
31 | // Start the SDK
32 | NotificationHub.Start(Constants.ConnectionString, Constants.HubName);
33 | }
34 | }
35 | ```
36 |
37 | We can then listen for messages using the `OnNotificationMessageReceived` method which has the title, body, and dictionary of the message itself. Here, you can display the message contents.
38 |
39 | ```csharp
40 | private void OnNotificationMessageReceived(object sender, NotificationMessageReceivedEventArgs e)
41 | {
42 | // Write the message contents
43 | Console.WriteLine(e.Title);
44 | Console.WriteLine(e.Body);
45 | }
46 | ```
47 |
48 | We can listen for installation saved success or failures which can be helpful for diagnosing issues.
49 |
50 | ```csharp
51 | private void OnInstallationSaveFailed(object sender, InstallationSaveFailedEventArgs e)
52 | {
53 | Console.WriteLine($"Failed to save installation: {e.Exception.Message}");
54 | }
55 |
56 | private void OnInstallatedSaved(object sender, InstallationSavedEventArgs e)
57 | {
58 | Console.WriteLine($"Installation ID: {e.Installation.InstallationId} saved successfully");
59 | }
60 | ```
61 |
62 | ## Xamarin.iOS
63 |
64 | We also have a [Xamarin.iOS](bindings/NHubSampleXamariniOS) sample which shows the basic usage of the [Xamarin.Azure.NotificationHubs.iOS](https://www.nuget.org/packages/Xamarin.Azure.NotificationHubs.iOS/) NuGet package which is published through the [Xamarin Components](https://github.com/xamarin/XamarinComponents/tree/master/XPlat/AzureMessaging) repository.
65 |
66 | To get started, register for messages in the `AppDelegate.cs` class with the following code to listen for messages, set up installation lifecycle management, and to initialize the SDK with the Access Policy connection string and hub name.
67 |
68 | ```csharp
69 | using WindowsAzure.Messaging.NotificationHubs;
70 |
71 | [Register("AppDelegate")]
72 | public class AppDelegate : UIResponder, IUIApplicationDelegate
73 | {
74 | [Export("application:didFinishLaunchingWithOptions:")]
75 | public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
76 | {
77 | // Listen for messages
78 | MSNotificationHub.SetDelegate(new NotificationDelegate());
79 |
80 | // Listen for installation saved success/failure
81 | MSNotificationHub.SetLifecycleDelegate(new InstallationLifecycleDelegate());
82 |
83 | // Start the Notification Hub SDK
84 | MSNotificationHub.Start(Constants.ConnectionString, Constants.HubName);
85 |
86 | return true;
87 | }
88 | }
89 | ```
90 |
91 | To listen for messages from APNS, create a class that inherits from `MSNotificationHubDelegate` which has the `DidReceivePushNotification` method.
92 |
93 | ```csharp
94 | public class NotificationDelegate : MSNotificationHubDelegate
95 | {
96 | public override void DidReceivePushNotification(MSNotificationHub notificationHub, MSNotificationHubMessage message)
97 | {
98 | // Determine whether in foreground or background
99 | if (UIApplication.SharedApplication.ApplicationState == UIApplicationState.Background)
100 | {
101 | Console.WriteLine($"Message received in the background with title {message.Title} and body {message.Body}");
102 | }
103 | else
104 | {
105 | Console.WriteLine($"Message received in the foreground with title {message.Title} and body {message.Body}");
106 | }
107 | }
108 | }
109 | ```
110 |
111 | To listen to lifecycle management such as whether the installation save succeeded or failed on the backend, you can implement a class which inherits from the `MSInstallationLifecycleDelegate` class.
112 |
113 | ```csharp
114 | public class InstallationLifecycleDelegate : MSInstallationLifecycleDelegate
115 | {
116 | public override void DidFailToSaveInstallation(MSNotificationHub notificationHub, MSInstallation installation, NSError error)
117 | {
118 | Console.WriteLine($"Save installation failed with exception: {error.LocalizedDescription}");
119 | }
120 |
121 | public override void DidSaveInstallation(MSNotificationHub notificationHub, MSInstallation installation)
122 | {
123 | Console.WriteLine($"Installation successfully saved with Installation ID: {installation.InstallationId}");
124 | }
125 | }
126 | ```
127 |
128 | ## Xamarin.Android
129 |
130 | In addition to Xamarin Forms, we also have a sample using [Xamarin.Android](bindings/NHubSampleXamarinAndroid) which shows the basic usage of the [Xamarin.Azure.NotificationHubs.Android](https://www.nuget.org/packages/Xamarin.Azure.NotificationHubs.Android/) NuGet package which is published through the [Xamarin Components](https://github.com/xamarin/XamarinComponents/tree/master/XPlat/AzureMessaging) repository.
131 |
132 | To get started, register for messages in the `MainActivity.cs` class with the following code to listen for messages, set up installation lifecycle management, and to initialize the SDK with the Access Policy connection string and hub name.
133 |
134 | ```csharp
135 | using WindowsAzure.Messaging.NotificationHubs;
136 |
137 | public class MainActivity : AppCompatActivity
138 | {
139 | protected override void OnCreate(Bundle savedInstanceState)
140 | {
141 | // Set listener for receiving messages
142 | NotificationHub.SetListener(new SampleNotificationListener());
143 |
144 | // Set listener for installation save success and failure
145 | NotificationHub.SetInstallationSavedListener(new InstallationSavedListener());
146 | NotificationHub.SetInstallationSaveFailureListener(new InstallationSaveFailedListener());
147 |
148 | // Initialize with hub name and connection string
149 | NotificationHub.Start(Application, Constants.HubName, Constants.ConnectionString);
150 | }
151 | }
152 | ```
153 |
154 | To listen for messages from Firebase, create a class that inherits from `INotificationListener` interface which has the `OnPushNotificationReceived` method.
155 |
156 | ```csharp
157 | public class SampleNotificationListener : Java.Lang.Object, INotificationListener
158 | {
159 | public void OnPushNotificationReceived(Context context, INotificationMessage message)
160 | {
161 | Console.WriteLine($"Message received with title {message.Title} and body {message.Body}");
162 | }
163 | }
164 | ```
165 |
166 | To listen to lifecycle management such as whether the installation save succeeded or failed on the backend, you can implement classes which inherits from the `IInstallationAdapterListener` interface for successful saves with the `OnInstallationSaved` method which contains the current `Installation`.
167 |
168 | ```csharp
169 | // Listen for installation saved success
170 | public class InstallationSavedListener : Java.Lang.Object, IInstallationAdapterListener
171 | {
172 | public void OnInstallationSaved(Installation installation)
173 | {
174 | Console.WriteLine($"Installation successfully saved with Installation ID: {installation.InstallationId}");
175 | }
176 | }
177 | ```
178 |
179 | We can then listen for installation saved failures using the `IInstallationAdapterErrorListener` interface which has the `OnInstallationSaveError` method with the exception.
180 |
181 | ```csharp
182 | public class InstallationSaveFailedListener : Java.Lang.Object, IInstallationAdapterErrorListener
183 | {
184 | public void OnInstallationSaveError(Java.Lang.Exception javaException)
185 | {
186 | var exception = Throwable.FromException(javaException);
187 | Console.WriteLine($"Save installation failed with exception: {exception.Message}");
188 | }
189 | }
190 | ```
191 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/InstallationEnrichmentVisitor.cs:
--------------------------------------------------------------------------------
1 | using WindowsAzure.Messaging.NotificationHubs;
2 |
3 | namespace NHubSampleXamarinAndroid
4 | {
5 | public class InstallationEnrichmentVisitor : Java.Lang.Object, IInstallationVisitor
6 | {
7 | public void VisitInstallation(Installation installation)
8 | {
9 | // Add a sample tag
10 | installation.AddTag("platform_XamarinAndroid");
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/InstallationSaveFailedListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Java.Lang;
3 | using WindowsAzure.Messaging.NotificationHubs;
4 |
5 | namespace NHubSampleXamarinAndroid
6 | {
7 | public class InstallationSaveFailedListener : Java.Lang.Object, IInstallationAdapterErrorListener
8 | {
9 | public InstallationSaveFailedListener()
10 | {
11 | }
12 |
13 | public void OnInstallationSaveError(Java.Lang.Exception javaException)
14 | {
15 | var exception = Throwable.FromException(javaException);
16 | Console.WriteLine($"Save installation failed with exception: {exception.Message}");
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/InstallationSavedListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using WindowsAzure.Messaging.NotificationHubs;
3 |
4 | namespace NHubSampleXamarinAndroid
5 | {
6 | public class InstallationSavedListener : Java.Lang.Object, IInstallationAdapterListener
7 | {
8 | public void OnInstallationSaved(Installation installation)
9 | {
10 | Console.WriteLine($"Installation successfully saved with Installation ID: {installation.InstallationId}");
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Android.App;
4 | using Android.OS;
5 | using Android.Runtime;
6 | using Android.Support.Design.Widget;
7 | using Android.Support.V7.App;
8 | using Android.Views;
9 | using WindowsAzure.Messaging.NotificationHubs;
10 | using Xamarin.Essentials;
11 |
12 | namespace NHubSampleXamarinAndroid
13 | {
14 | [Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true)]
15 | public class MainActivity : AppCompatActivity
16 | {
17 | protected override void OnCreate(Bundle savedInstanceState)
18 | {
19 | base.OnCreate(savedInstanceState);
20 | Xamarin.Essentials.Platform.Init(this, savedInstanceState);
21 | SetContentView(Resource.Layout.activity_main);
22 |
23 | // Read the connections and hub name from somewhere
24 | var connectionString = "";
25 | var hubName = "";
26 |
27 | // Set listener for receiving messages
28 | NotificationHub.SetListener(new SampleNotificationListener());
29 |
30 | // Set an enrichment visitor
31 | NotificationHub.UseVisitor(new InstallationEnrichmentVisitor());
32 |
33 | // Set listener for installation save success and failure
34 | NotificationHub.SetInstallationSavedListener(new InstallationSavedListener());
35 | NotificationHub.SetInstallationSaveFailureListener(new InstallationSaveFailedListener());
36 |
37 | // Initialize with hub name and connection string
38 | NotificationHub.Start(Application, hubName, connectionString);
39 |
40 | // Add a tag
41 | NotificationHub.AddTag("target_XamarinAndroid");
42 |
43 | Android.Support.V7.Widget.Toolbar toolbar = FindViewById(Resource.Id.toolbar);
44 | SetSupportActionBar(toolbar);
45 |
46 | FloatingActionButton fab = FindViewById(Resource.Id.fab);
47 | fab.Click += FabOnClick;
48 | }
49 |
50 | public void AddTags()
51 | {
52 | var language = Resources.Configuration.Locales.Get(0).Language;
53 | var countryCode = Resources.Configuration.Locales.Get(0).Country;
54 |
55 | var languageTag = $"language_{language}";
56 | var countryCodeTag = $"country_{countryCode}";
57 |
58 | NotificationHub.AddTags(new [] { languageTag, countryCodeTag });
59 | }
60 |
61 | public void AddTemplate()
62 | {
63 | var language = Resources.Configuration.Locales.Get(0).Language;
64 | var countryCode = Resources.Configuration.Locales.Get(0).Country;
65 |
66 | var languageTag = $"language_{language}";
67 | var countryCodeTag = $"country_{countryCode}";
68 |
69 | var body = "{\"data\":{\"message\":\"$(message)\"}}";
70 | var template = new InstallationTemplate();
71 | template.Body = body;
72 |
73 | template.AddTags(new[] { languageTag, countryCodeTag });
74 |
75 | NotificationHub.SetTemplate("template1", template);
76 | }
77 |
78 | public override bool OnCreateOptionsMenu(IMenu menu)
79 | {
80 | MenuInflater.Inflate(Resource.Menu.menu_main, menu);
81 | return true;
82 | }
83 |
84 | public override bool OnOptionsItemSelected(IMenuItem item)
85 | {
86 | int id = item.ItemId;
87 | if (id == Resource.Id.action_settings)
88 | {
89 | return true;
90 | }
91 |
92 | return base.OnOptionsItemSelected(item);
93 | }
94 |
95 | private void FabOnClick(object sender, EventArgs eventArgs)
96 | {
97 | View view = (View)sender;
98 | Snackbar.Make(view, "Replace with your own action", Snackbar.LengthLong)
99 | .SetAction("Action", (View.IOnClickListener)null).Show();
100 | }
101 |
102 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
103 | {
104 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
105 |
106 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/NHubSampleXamarinAndroid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {37D1A3E8-3A1D-4A57-9BB8-3491162637B1}
9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | {84dd83c5-0fe3-4294-9419-09e7c8ba324f}
11 | Library
12 | Properties
13 | NHubSampleXamarinAndroid
14 | NHubSampleXamarinAndroid
15 | 512
16 | True
17 | True
18 | Resources\Resource.designer.cs
19 | Resource
20 | Off
21 | v10.0
22 | Properties\AndroidManifest.xml
23 | Resources
24 | Assets
25 | true
26 | true
27 |
28 |
29 | True
30 | portable
31 | False
32 | bin\Debug\
33 | DEBUG;TRACE
34 | prompt
35 | 4
36 | True
37 | None
38 | False
39 |
40 |
41 | True
42 | portable
43 | True
44 | bin\Release\
45 | TRACE
46 | prompt
47 | 4
48 | true
49 | False
50 | SdkOnly
51 | True
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | Designer
79 |
80 |
81 | Designer
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
136 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/NHubSampleXamarinAndroid.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHubSampleXamarinAndroid", "NHubSampleXamarinAndroid.csproj", "{37D1A3E8-3A1D-4A57-9BB8-3491162637B1}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {37D1A3E8-3A1D-4A57-9BB8-3491162637B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {37D1A3E8-3A1D-4A57-9BB8-3491162637B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {37D1A3E8-3A1D-4A57-9BB8-3491162637B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {37D1A3E8-3A1D-4A57-9BB8-3491162637B1}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | EndGlobal
18 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/NotificationListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.Content;
3 | using WindowsAzure.Messaging.NotificationHubs;
4 |
5 | namespace NHubSampleXamarinAndroid
6 | {
7 | public class SampleNotificationListener : Java.Lang.Object, INotificationListener
8 | {
9 | public SampleNotificationListener()
10 | {
11 | }
12 |
13 | public void OnPushNotificationReceived(Context context, INotificationMessage message)
14 | {
15 | Console.WriteLine($"Message received with title {message.Title} and body {message.Body}");
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("NHubSampleXamarinAndroid")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("NHubSampleXamarinAndroid")]
14 | [assembly: AssemblyCopyright("Copyright © 2018")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | [assembly: AssemblyVersion("1.0.0.0")]
26 | [assembly: AssemblyFileVersion("1.0.0.0")]
27 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.xml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.xml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamarinAndroid/Resources/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2c3e50
4 | #1B3147
5 | #3498db
6 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2C3E50
4 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | NHubSampleXamarinAndroid
4 | Settings
5 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamarinAndroid/SampleInstallationAdapter.cs:
--------------------------------------------------------------------------------
1 |
2 | using WindowsAzure.Messaging.NotificationHubs;
3 |
4 | namespace NHubSampleXamarinAndroid
5 | {
6 | public class SampleInstallationAdapter : Java.Lang.Object, IInstallationAdapter
7 | {
8 | public void SaveInstallation(Installation installation,
9 | IInstallationAdapterListener installationAdapterListener,
10 | IInstallationAdapterErrorListener installationAdapterErrorListener)
11 | {
12 | // Save to your own backend
13 |
14 | // Call if successfully saved
15 | installationAdapterListener.OnInstallationSaved(installation);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Foundation;
3 | using UIKit;
4 | using WindowsAzure.Messaging.NotificationHubs;
5 |
6 | namespace NHubSampleXamariniOS
7 | {
8 | // The UIApplicationDelegate for the application. This class is responsible for launching the
9 | // User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
10 | [Register("AppDelegate")]
11 | public class AppDelegate : UIResponder, IUIApplicationDelegate
12 | {
13 |
14 | [Export("window")]
15 | public UIWindow Window { get; set; }
16 |
17 | [Export("application:didFinishLaunchingWithOptions:")]
18 | public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
19 | {
20 | // Get settings from the DevSettings plist
21 | var path = NSBundle.MainBundle.PathForResource("DevSettings", "plist");
22 | var configValues = NSDictionary.FromFile(path);
23 |
24 | // Read from the plist
25 | var connectionString = configValues.ObjectForKey(new NSString("ConnectionString"));
26 | var hubName = configValues.ObjectForKey(new NSString("HubName"));
27 |
28 | if (connectionString == null || hubName == null)
29 | {
30 | Console.WriteLine("Connection String and Hub Name missing");
31 | return false;
32 | }
33 |
34 | // Set a listener for messages
35 | MSNotificationHub.SetDelegate(new NotificationDelegate());
36 |
37 | // Set a listener for lifecycle management
38 | MSNotificationHub.SetLifecycleDelegate(new InstallationLifecycleDelegate());
39 |
40 | // Start the SDK
41 | MSNotificationHub.Start(connectionString.ToString(), hubName.ToString());
42 |
43 | // Add some tags
44 | AddTags();
45 |
46 | // Override point for customization after application launch.
47 | // If not required for your application you can safely delete this method
48 | return true;
49 | }
50 |
51 | public void AddTags()
52 | {
53 | var language = NSBundle.MainBundle.PreferredLocalizations[0];
54 | var countryCode = NSLocale.CurrentLocale.CountryCode;
55 |
56 | var languageTag = $"language_{language}";
57 | var countryCodeTag = $"country_{countryCode}";
58 |
59 | MSNotificationHub.AddTag(languageTag);
60 | MSNotificationHub.AddTag(countryCodeTag);
61 | }
62 |
63 | public void AddTemplate()
64 | {
65 | var language = NSBundle.MainBundle.PreferredLocalizations[0];
66 | var countryCode = NSLocale.CurrentLocale.CountryCode;
67 |
68 | var languageTag = $"language_{language}";
69 | var countryCodeTag = $"country_{countryCode}";
70 |
71 | var body = "{\"aps\": {\"alert\": \"$(message)\"}}";
72 | var template = new MSInstallationTemplate();
73 | template.Body = body;
74 | template.AddTag(languageTag);
75 | template.AddTag(countryCodeTag);
76 |
77 | MSNotificationHub.SetTemplate(template, key: "template1");
78 | }
79 |
80 | // UISceneSession Lifecycle
81 |
82 | [Export("application:configurationForConnectingSceneSession:options:")]
83 | public UISceneConfiguration GetConfiguration(UIApplication application, UISceneSession connectingSceneSession, UISceneConnectionOptions options)
84 | {
85 | // Called when a new scene session is being created.
86 | // Use this method to select a configuration to create the new scene with.
87 | return UISceneConfiguration.Create("Default Configuration", connectingSceneSession.Role);
88 | }
89 |
90 | [Export("application:didDiscardSceneSessions:")]
91 | public void DidDiscardSceneSessions(UIApplication application, NSSet sceneSessions)
92 | {
93 | // Called when the user discards a scene session.
94 | // If any sessions were discarded while the application was not running, this will be called shortly after `FinishedLaunching`.
95 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
96 | }
97 | }
98 | }
99 |
100 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/3d8ef12a4ff09a9b48165ebd932b333fbdf3474c/samples/bindings/NHubSampleXamariniOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/DevSettings.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ConnectionString
6 |
7 | HubName
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | development
7 |
8 |
9 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | NHubSampleXamariniOS
7 | CFBundleIdentifier
8 | com.microsoft.NHubSampleXamariniOS
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1.0
13 | LSRequiresIPhoneOS
14 |
15 | UIApplicationSceneManifest
16 |
17 | UIApplicationSupportsMultipleScenes
18 |
19 | UISceneConfigurations
20 |
21 | UIWindowSceneSessionRoleApplication
22 |
23 |
24 | UISceneConfigurationName
25 | Default Configuration
26 | UISceneDelegateClassName
27 | SceneDelegate
28 | UISceneStoryboardFile
29 | Main
30 |
31 |
32 |
33 |
34 | MinimumOSVersion
35 | 13.5
36 | UIDeviceFamily
37 |
38 | 1
39 | 2
40 |
41 | UILaunchStoryboardName
42 | LaunchScreen
43 | UIMainStoryboardFile
44 | Main
45 | UIMainStoryboardFile~ipad
46 | Main
47 | UIRequiredDeviceCapabilities
48 |
49 | armv7
50 |
51 | UISupportedInterfaceOrientations
52 |
53 | UIInterfaceOrientationPortrait
54 | UIInterfaceOrientationLandscapeLeft
55 | UIInterfaceOrientationLandscapeRight
56 |
57 | UISupportedInterfaceOrientations~ipad
58 |
59 | UIInterfaceOrientationPortrait
60 | UIInterfaceOrientationPortraitUpsideDown
61 | UIInterfaceOrientationLandscapeLeft
62 | UIInterfaceOrientationLandscapeRight
63 |
64 | XSAppIconAssets
65 | Assets.xcassets/AppIcon.appiconset
66 | UIBackgroundModes
67 |
68 | remote-notification
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/InstallationEnrichmentDelegate.cs:
--------------------------------------------------------------------------------
1 | using WindowsAzure.Messaging.NotificationHubs;
2 |
3 | namespace NHubSampleXamariniOS
4 | {
5 | public class InstallationEnrichmentDelegate : MSInstallationEnrichmentDelegate
6 | {
7 | public override void WillEnrichInstallation(MSNotificationHub notificationHub, MSInstallation installation)
8 | {
9 | installation.AddTag("platform_Xamarin");
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/InstallationLifecycleDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Foundation;
3 | using WindowsAzure.Messaging.NotificationHubs;
4 |
5 | namespace NHubSampleXamariniOS
6 | {
7 | public class InstallationLifecycleDelegate : MSInstallationLifecycleDelegate
8 | {
9 | public InstallationLifecycleDelegate()
10 | {
11 | }
12 |
13 | public override void DidFailToSaveInstallation(MSNotificationHub notificationHub, MSInstallation installation, NSError error)
14 | {
15 | Console.WriteLine($"Save installation failed with exception: {error.LocalizedDescription}");
16 | }
17 |
18 | public override void DidSaveInstallation(MSNotificationHub notificationHub, MSInstallation installation)
19 | {
20 | Console.WriteLine($"Installation successfully saved with Installation ID: {installation.InstallationId}");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/InstallationManagementDelegate.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using WindowsAzure.Messaging.NotificationHubs;
3 |
4 | namespace NHubSampleXamariniOS
5 | {
6 | public class InstallationManagementDelegate : MSInstallationManagementDelegate
7 | {
8 | public override void WillUpsertInstallation(MSNotificationHub notificationHub, MSInstallation installation, NullableCompletionHandler completionHandler)
9 | {
10 | // Save the installation to your own backend
11 | // Finish with a completion with error if one occurred, else null
12 | completionHandler(null);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Main.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace NHubSampleXamariniOS
4 | {
5 | public class Application
6 | {
7 | // This is the main entry point of the application.
8 | static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, "AppDelegate");
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/NHubSampleXamariniOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | {4359D883-0988-4645-B32C-851CF637E8BA}
7 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | {edc1b0fa-90cd-4038-8fad-98fe74adb368}
9 | Exe
10 | NHubSampleXamariniOS
11 | NHubSampleXamariniOS
12 | Resources
13 | true
14 | NSUrlSessionHandler
15 | PackageReference
16 | automatic
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\iPhoneSimulator\Debug
23 | DEBUG
24 | prompt
25 | 4
26 | x86_64
27 | None
28 | true
29 |
30 |
31 | none
32 | true
33 | bin\iPhoneSimulator\Release
34 | prompt
35 | 4
36 | None
37 | x86_64
38 |
39 |
40 | true
41 | full
42 | false
43 | bin\iPhone\Debug
44 | DEBUG
45 | prompt
46 | 4
47 | ARM64
48 | Entitlements.plist
49 | iPhone Developer
50 | true
51 | SdkOnly
52 |
53 |
54 | none
55 | true
56 | bin\iPhone\Release
57 | prompt
58 | 4
59 | Entitlements.plist
60 | ARM64
61 | iPhone Developer
62 | SdkOnly
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | false
79 |
80 |
81 | false
82 |
83 |
84 | false
85 |
86 |
87 | false
88 |
89 |
90 | false
91 |
92 |
93 | false
94 |
95 |
96 | false
97 |
98 |
99 | false
100 |
101 |
102 | false
103 |
104 |
105 | false
106 |
107 |
108 | false
109 |
110 |
111 | false
112 |
113 |
114 | false
115 |
116 |
117 | false
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | ViewController.cs
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/NHubSampleXamariniOS.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHubSampleXamariniOS", "NHubSampleXamariniOS.csproj", "{4359D883-0988-4645-B32C-851CF637E8BA}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
9 | Release|iPhoneSimulator = Release|iPhoneSimulator
10 | Debug|iPhone = Debug|iPhone
11 | Release|iPhone = Release|iPhone
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4359D883-0988-4645-B32C-851CF637E8BA}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
15 | {4359D883-0988-4645-B32C-851CF637E8BA}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
16 | {4359D883-0988-4645-B32C-851CF637E8BA}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
17 | {4359D883-0988-4645-B32C-851CF637E8BA}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
18 | {4359D883-0988-4645-B32C-851CF637E8BA}.Debug|iPhone.ActiveCfg = Debug|iPhone
19 | {4359D883-0988-4645-B32C-851CF637E8BA}.Debug|iPhone.Build.0 = Debug|iPhone
20 | {4359D883-0988-4645-B32C-851CF637E8BA}.Release|iPhone.ActiveCfg = Release|iPhone
21 | {4359D883-0988-4645-B32C-851CF637E8BA}.Release|iPhone.Build.0 = Release|iPhone
22 | EndGlobalSection
23 | EndGlobal
24 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/NotificationDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UIKit;
3 | using WindowsAzure.Messaging.NotificationHubs;
4 |
5 | namespace NHubSampleXamariniOS
6 | {
7 | public class NotificationDelegate : MSNotificationHubDelegate
8 | {
9 | public NotificationDelegate()
10 | {
11 | }
12 |
13 | public override void DidReceivePushNotification(MSNotificationHub notificationHub, MSNotificationHubMessage message)
14 | {
15 | if (UIApplication.SharedApplication.ApplicationState == UIApplicationState.Background)
16 | {
17 | Console.WriteLine($"Message received in the background with title {message.Title} and body {message.Body}");
18 | }
19 | else
20 | {
21 | Console.WriteLine($"Message received in the foreground with title {message.Title} and body {message.Body}");
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NHubSampleXamariniOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NHubSampleXamariniOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/Resources/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/SceneDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Foundation;
3 | using UIKit;
4 |
5 | namespace NewSingleViewTemplate
6 | {
7 | [Register("SceneDelegate")]
8 | public class SceneDelegate : UIResponder, IUIWindowSceneDelegate
9 | {
10 |
11 | [Export("window")]
12 | public UIWindow Window { get; set; }
13 |
14 | [Export("scene:willConnectToSession:options:")]
15 | public void WillConnect(UIScene scene, UISceneSession session, UISceneConnectionOptions connectionOptions)
16 | {
17 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
18 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
19 | // This delegate does not imply the connecting scene or session are new (see UIApplicationDelegate `GetConfiguration` instead).
20 | }
21 |
22 | [Export("sceneDidDisconnect:")]
23 | public void DidDisconnect(UIScene scene)
24 | {
25 | // Called as the scene is being released by the system.
26 | // This occurs shortly after the scene enters the background, or when its session is discarded.
27 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
28 | // The scene may re-connect later, as its session was not neccessarily discarded (see UIApplicationDelegate `DidDiscardSceneSessions` instead).
29 | }
30 |
31 | [Export("sceneDidBecomeActive:")]
32 | public void DidBecomeActive(UIScene scene)
33 | {
34 | // Called when the scene has moved from an inactive state to an active state.
35 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
36 | }
37 |
38 | [Export("sceneWillResignActive:")]
39 | public void WillResignActive(UIScene scene)
40 | {
41 | // Called when the scene will move from an active state to an inactive state.
42 | // This may occur due to temporary interruptions (ex. an incoming phone call).
43 | }
44 |
45 | [Export("sceneWillEnterForeground:")]
46 | public void WillEnterForeground(UIScene scene)
47 | {
48 | // Called as the scene transitions from the background to the foreground.
49 | // Use this method to undo the changes made on entering the background.
50 | }
51 |
52 | [Export("sceneDidEnterBackground:")]
53 | public void DidEnterBackground(UIScene scene)
54 | {
55 | // Called as the scene transitions from the foreground to the background.
56 | // Use this method to save data, release shared resources, and store enough scene-specific state information
57 | // to restore the scene back to its current state.
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/ViewController.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 | using System;
3 | using UIKit;
4 |
5 | namespace NHubSampleXamariniOS
6 | {
7 | public partial class ViewController : UIViewController
8 | {
9 | public ViewController(IntPtr handle) : base(handle)
10 | {
11 | }
12 |
13 | public override void ViewDidLoad()
14 | {
15 | base.ViewDidLoad();
16 | // Perform any additional setup after loading the view, typically from a nib.
17 | }
18 |
19 | public override void DidReceiveMemoryWarning()
20 | {
21 | base.DidReceiveMemoryWarning();
22 | // Release any cached data, images, etc that aren't in use.
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/samples/bindings/NHubSampleXamariniOS/ViewController.designer.cs:
--------------------------------------------------------------------------------
1 | // WARNING
2 | //
3 | // This file has been generated automatically by Visual Studio from the outlets and
4 | // actions declared in your storyboard file.
5 | // Manual changes to this file will not be maintained.
6 | //
7 | using Foundation;
8 | using System;
9 | using System.CodeDom.Compiler;
10 | using UIKit;
11 |
12 | namespace NHubSampleXamariniOS
13 | {
14 | [Register("ViewController")]
15 | partial class ViewController
16 | {
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.NotificationHubs.Client", "Microsoft.Azure.NotificationHubs.Client\Microsoft.Azure.NotificationHubs.Client.csproj", "{AB66370D-AB90-40CD-97EC-55974DEC0871}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {AB66370D-AB90-40CD-97EC-55974DEC0871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {AB66370D-AB90-40CD-97EC-55974DEC0871}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {AB66370D-AB90-40CD-97EC-55974DEC0871}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {AB66370D-AB90-40CD-97EC-55974DEC0871}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | EndGlobal
18 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/IInstallationEnrichmentAdapter.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.Azure.NotificationHubs.Client
2 | {
3 | ///
4 | /// This represents a way to enrich the current installation before it is sent to the back-end.
5 | ///
6 | public interface IInstallationEnrichmentAdapter
7 | {
8 | ///
9 | /// Enriches an installation before being sent to the back-end.
10 | ///
11 | /// The installation to enrich.
12 | void EnrichInstallation(Installation installation);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/IInstallationManagementAdapter.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.Azure.NotificationHubs.Client
4 | {
5 | ///
6 | /// This represents an adapter to allows the user to save the installation on the back-end and report back either success or failure.
7 | ///
8 | public interface IInstallationManagementAdapter
9 | {
10 | ///
11 | /// Saves an installation to a back-end. To finish the call, one must invoke onSuccess for success or onError for failure.
12 | ///
13 | /// The installation to save the back-end.
14 | /// The success action to invoke upon successful save.
15 | /// The failure action to invoke when a save has failed.
16 | void SaveInstallation(Installation installation, Action onSuccess, Action onError);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/Installation.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Microsoft.Azure.NotificationHubs.Client
5 | {
6 | ///
7 | /// This class represents an Azure Notification Hubs Installation.
8 | ///
9 | public class Installation
10 | {
11 | ///
12 | /// The ID for the installation.
13 | ///
14 | public string InstallationId { get; set; }
15 |
16 | ///
17 | /// The PNS specific push channel for the installation.
18 | ///
19 | public string PushChannel { get; set; }
20 |
21 | ///
22 | /// The expiration time for the installation.
23 | ///
24 | public DateTime? ExpirationTime { get; set; }
25 |
26 | ///
27 | /// Gets or sets the user ID for the installation.
28 | ///
29 | public string UserId { get; set; }
30 |
31 | ///
32 | /// The tags for the installation.
33 | ///
34 | public ICollection Tags { get; set; }
35 |
36 | ///
37 | /// The templates for the installation.
38 | ///
39 | public IDictionary Templates { get; set; }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/InstallationSaveFailedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.Azure.NotificationHubs.Client
4 | {
5 | ///
6 | /// The EventArgs for when an installation save has failed.
7 | ///
8 | public class InstallationSaveFailedEventArgs : EventArgs
9 | {
10 | ///
11 | /// The exception from saving the installation.
12 | ///
13 | public Exception Exception { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/InstallationSavedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.Azure.NotificationHubs.Client
4 | {
5 | ///
6 | /// The EventArgs for when an installation has been saved successfully.
7 | ///
8 | public class InstallationSavedEventArgs : EventArgs
9 | {
10 | ///
11 | /// The installation that was saved to the backend.
12 | ///
13 | public Installation Installation { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/InstallationTemplate.shared.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Microsoft.Azure.NotificationHubs.Client
4 | {
5 | ///
6 | /// The Installation Template for Installations.
7 | ///
8 | public class InstallationTemplate
9 | {
10 | ///
11 | /// The body of the template.
12 | ///
13 | public string Body { get; set; }
14 |
15 | ///
16 | /// The tags for the template.
17 | ///
18 | public IList Tags { get; set; }
19 |
20 | ///
21 | /// The headers for the template.
22 | ///
23 | public IDictionary Headers { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/Microsoft.Azure.NotificationHubs.Client.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Library
4 | Microsoft.Azure.NotificationHubs.Client
5 | Microsoft.Azure.NotificationHubs.Client
6 |
7 |
8 | Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20;MonoAndroid10.0;netstandard2.1;netstandard2.0;net5.0;net6.0
9 | $(AssemblyName) ($(TargetFramework))
10 | 1.0.0.0
11 | 1.0.0.0
12 | 1.0.0.0
13 | en
14 | Azure;Push;NotificationHubs
15 |
16 |
17 | false
18 |
19 |
20 | $(DefineConstants);
21 |
22 |
23 | default
24 |
25 |
26 | true
27 | true
28 | true
29 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
30 | true
31 | Microsoft.Azure.NotificationHubs.Client
32 | 1.0.2
33 | https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/main/.github/icons/aznh-icon-128x128.png
34 | aznh-icon-128x128.png
35 | MIT
36 | https://github.com/Azure/azure-notificationhubs-xamarin/
37 | Microsoft
38 | Microsoft
39 | Azure Notification Hubs SDK for Xamarin Forms
40 | Azure Notification Hubs SDK for Xamarin Forms
41 | false
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | full
72 | true
73 | false
74 | bin\Debug
75 | DEBUG;TRACE
76 | prompt
77 | 4
78 |
79 |
80 |
81 |
82 | embedded
83 | true
84 | bin\Release
85 | TRACE
86 | prompt
87 | 4
88 |
89 | true
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/NotificationHub.net.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.Azure.NotificationHubs.Client
4 | {
5 | public partial class NotificationHub
6 | {
7 | static string PlatformPushChannel => throw new NotImplementedException();
8 | static void PlatformSaveInstallation() => throw new NotImplementedException();
9 | static void PlatformInitialize(string connectionString, string hubName) => throw new NotImplementedException();
10 | static void PlatformInitialize(IInstallationManagementAdapter installationManagementAdapter) => throw new NotImplementedException();
11 | static void PlatformSetEnricher() => throw new NotImplementedException();
12 |
13 | static string PlatformGetUserId() => throw new NotImplementedException();
14 | static void PlatformSetUserId(string value) => throw new NotImplementedException();
15 |
16 | #region Tags
17 |
18 | static bool PlatformAddTag(string tag) => default;
19 | static bool PlatformAddTags(string[] tags) => default;
20 | static void PlatformClearTags() => throw new NotImplementedException();
21 | static bool PlatformRemoveTag(string tag) => default;
22 | static bool PlatformRemoveTags(string[] tags) => default;
23 | static string[] PlatformGetTags() => default;
24 |
25 | #endregion
26 |
27 | #region Templates
28 |
29 | static void PlatformSetTemplate(string name, InstallationTemplate template) => throw new NotImplementedException();
30 | static void PlatformRemoveTemplate(string name) => throw new NotImplementedException();
31 | static InstallationTemplate PlatformGetTemplate(string name) => throw new NotImplementedException();
32 |
33 | #endregion
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/NotificationHub.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.Azure.NotificationHubs.Client
4 | {
5 | ///
6 | /// Handles the interactions with Azure Notification Hubs
7 | ///
8 | public partial class NotificationHub
9 | {
10 | ///
11 | /// Gets or set the user ID.
12 | ///
13 | public static string UserId
14 | {
15 | get => PlatformGetUserId();
16 | set => PlatformSetUserId(value);
17 | }
18 |
19 | ///
20 | /// Gets the platform specific push channel
21 | ///
22 | public static string PushChannel => PlatformPushChannel;
23 |
24 | ///
25 | /// Saves the installation to the backend. Note this should not be used in most cases.
26 | ///
27 | public static void SaveInstallation() => PlatformSaveInstallation();
28 |
29 | ///
30 | /// An event which fires when a push notification has been received.
31 | ///
32 | public static EventHandler NotificationMessageReceived;
33 |
34 | ///
35 | /// An event which fires when the installation has been saved to the backend.
36 | ///
37 | public static EventHandler InstallationSaved;
38 |
39 | ///
40 | /// An event which fires when the installation has failed to save on the backend.
41 | ///
42 | public static EventHandler InstallationSaveFailed;
43 |
44 | ///
45 | /// Starts the Notification Hub with a connection string from the Access Policy and the Hub Name.
46 | ///
47 | /// The connection string from the Access Policy.
48 | /// The Azure Notification Hub name.
49 | public static void Start(string connectionString, string hubName) => PlatformInitialize(connectionString, hubName);
50 |
51 | ///
52 | /// Starts the Notification Hub with a custom backend for saving an installation.
53 | ///
54 | /// The installation management adapter to save an installation to a custom backend.
55 | public static void Start(IInstallationManagementAdapter installationManagementAdapter) => PlatformInitialize(installationManagementAdapter);
56 |
57 |
58 | #region Tags
59 |
60 | ///
61 | /// Adds a tag to the installation.
62 | ///
63 | /// The tag to add to the installation.
64 | /// Returns true if added, otherwise false.
65 | public static bool AddTag(string tag) => PlatformAddTag(tag);
66 |
67 | ///
68 | /// Adds an array of tags to the installation.
69 | ///
70 | /// The tags to add to the installation.
71 | /// Returns true if added, otherwise false.
72 | public static bool AddTags(string[] tags) => PlatformAddTags(tags);
73 |
74 | ///
75 | /// Clears the tags from the installation.
76 | ///
77 | public static void ClearTags() => PlatformClearTags();
78 |
79 | ///
80 | /// Removes a tag from the installation.
81 | ///
82 | /// The tag to remove from the installation.
83 | /// Returns true if removed, otherwise false.
84 | public static bool RemoveTag(string tag) => PlatformRemoveTag(tag);
85 |
86 | ///
87 | /// Removes an array of tags from the installation.
88 | ///
89 | /// The tags to remove from the installation.
90 | /// Returns true if removed, false otherwise.
91 | public static bool RemoveTags(string[] tags) => PlatformRemoveTags(tags);
92 |
93 | ///
94 | /// Gets an array of the tags on the installation.
95 | ///
96 | /// The tags on the installation.
97 | public static string[] GetTags() => PlatformGetTags();
98 |
99 | #endregion
100 |
101 | #region Templates
102 |
103 | ///
104 | /// Sets the Installation Template for the given name.
105 | ///
106 | /// The name for the installation template.
107 | /// The installation template to save to the installation.
108 | public static void SetTemplate(string name, InstallationTemplate template) => PlatformSetTemplate(name, template);
109 |
110 | ///
111 | /// Removes the Installation Template from the installation by the name.
112 | ///
113 | /// The name of the template to remove.
114 | public static void RemoveTemplate(string name) => PlatformRemoveTemplate(name);
115 |
116 | ///
117 | /// Gets the Installation Template by the name.
118 | ///
119 | /// The name of the Installation Template.
120 | /// The Installation Template that was stored with the given name.
121 | public static InstallationTemplate GetTemplate(string name) => PlatformGetTemplate(name);
122 |
123 | #endregion
124 |
125 | private static IInstallationEnrichmentAdapter s_enrichmentAdapter;
126 |
127 | ///
128 | /// Sets the installation enrichment adapter which allows to set properties on the installation before saving.
129 | ///
130 | /// The enrichment adapter to use to enrich the installation.
131 | public static void SetInstallationEnrichmentAdapter(IInstallationEnrichmentAdapter enrichmentAdapter)
132 | {
133 | s_enrichmentAdapter = enrichmentAdapter;
134 | PlatformSetEnricher();
135 | }
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/NotificationHubMessageDelegate.ios.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using WindowsAzure.Messaging.NotificationHubs;
3 |
4 | namespace Microsoft.Azure.NotificationHubs.Client
5 | {
6 | ///
7 | /// An implementation of the MSNotificationHubDelegate to intercept messages from APNS.
8 | ///
9 | public class NotificationHubMessageDelegate : MSNotificationHubDelegate
10 | {
11 | ///
12 | /// Invoked when a push notification has been received with the notification hub and message.
13 | ///
14 | /// The current NotificationHub instance.
15 | /// The message from APNS.
16 | public override void DidReceivePushNotification(MSNotificationHub notificationHub, MSNotificationHubMessage message)
17 | {
18 | OnNotificationMessageReceivedAction?.Invoke(message);
19 | }
20 |
21 | ///
22 | /// An action to invoke when a message is received via DidReceivePushNotification.
23 | ///
24 | public Action OnNotificationMessageReceivedAction { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/NotificationListener.android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.Content;
3 | using WindowsAzure.Messaging.NotificationHubs;
4 |
5 | namespace Microsoft.Azure.NotificationHubs.Client
6 | {
7 | ///
8 | /// Implementation of a NotificationListener for Android to receive messages.
9 | ///
10 | public class NotificationListener : Java.Lang.Object, INotificationListener
11 | {
12 | ///
13 | /// Invoked when a push notification has been received with the context and message.
14 | ///
15 | /// The Android context.
16 | /// The message containing the properties.
17 | public void OnPushNotificationReceived(Context context, INotificationMessage message)
18 | {
19 | OnNotificationMessageReceivedAction?.Invoke(message);
20 | }
21 |
22 | ///
23 | /// The action to invoke when a message is received.
24 | ///
25 | public Action OnNotificationMessageReceivedAction;
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Microsoft.Azure.NotificationHubs.Client/NotificationMessageReceivedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Microsoft.Azure.NotificationHubs.Client
5 | {
6 | ///
7 | /// The EventArgs received when a push notification has been received.
8 | ///
9 | public class NotificationMessageReceivedEventArgs : EventArgs
10 | {
11 | ///
12 | /// The title of the push notification.
13 | ///
14 | public string Title { get; set; }
15 |
16 | ///
17 | /// The body of the push notification.
18 | ///
19 | public string Body { get; set; }
20 |
21 | ///
22 | /// The data from the push notification.
23 | ///
24 | public IDictionary Data { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/bindings/Android/Xamarin.Azure.NotificationHubs.Android/Additions/AboutAdditions.txt:
--------------------------------------------------------------------------------
1 | Additions allow you to add arbitrary C# to the generated classes
2 | before they are compiled. This can be helpful for providing convenience
3 | methods or adding pure C# classes.
4 |
5 | == Adding Methods to Generated Classes ==
6 |
7 | Let's say the library being bound has a Rectangle class with a constructor
8 | that takes an x and y position, and a width and length size. It will look like
9 | this:
10 |
11 | public partial class Rectangle
12 | {
13 | public Rectangle (int x, int y, int width, int height)
14 | {
15 | // JNI bindings
16 | }
17 | }
18 |
19 | Imagine we want to add a constructor to this class that takes a Point and
20 | Size structure instead of 4 ints. We can add a new file called Rectangle.cs
21 | with a partial class containing our new method:
22 |
23 | public partial class Rectangle
24 | {
25 | public Rectangle (Point location, Size size) :
26 | this (location.X, location.Y, size.Width, size.Height)
27 | {
28 | }
29 | }
30 |
31 | At compile time, the additions class will be added to the generated class
32 | and the final assembly will a Rectangle class with both constructors.
33 |
34 |
35 | == Adding C# Classes ==
36 |
37 | Another thing that can be done is adding fully C# managed classes to the
38 | generated library. In the above example, let's assume that there isn't a
39 | Point class available in Java or our library. The one we create doesn't need
40 | to interact with Java, so we'll create it like a normal class in C#.
41 |
42 | By adding a Point.cs file with this class, it will end up in the binding library:
43 |
44 | public class Point
45 | {
46 | public int X { get; set; }
47 | public int Y { get; set; }
48 | }
49 |
--------------------------------------------------------------------------------
/src/bindings/Android/Xamarin.Azure.NotificationHubs.Android/Jars/AboutJars.txt:
--------------------------------------------------------------------------------
1 | This directory is for Android .jars.
2 |
3 | There are 3 types of jars that are supported:
4 |
5 | == Input Jar and Embedded Jar ==
6 |
7 | This is the jar that bindings should be generated for.
8 |
9 | For example, if you were binding the Google Maps library, this would
10 | be Google's "maps.jar".
11 |
12 | The difference between EmbeddedJar and InputJar is, EmbeddedJar is to be
13 | embedded in the resulting dll as EmbeddedResource, while InputJar is not.
14 | There are couple of reasons you wouldn't like to embed the target jar
15 | in your dll (the ones that could be internally loaded by
16 | feature e.g. maps.jar, or you cannot embed jars that are under some
17 | proprietary license).
18 |
19 | Set the build action for these jars in the properties page to "InputJar".
20 |
21 |
22 | == Reference Jar and Embedded Reference Jar ==
23 |
24 | These are jars that are referenced by the input jar. C# bindings will
25 | not be created for these jars. These jars will be used to resolve
26 | types used by the input jar.
27 |
28 | NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
29 | based on the Target Framework selected.
30 |
31 | Set the build action for these jars in the properties page to "ReferenceJar".
32 |
33 | "EmbeddedJar" works like "ReferenceJar", but like "EmbeddedJar", it is
34 | embedded in your dll. But at application build time, they are not included
35 | in the final apk, like ReferenceJar files.
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/bindings/Android/Xamarin.Azure.NotificationHubs.Android/Transforms/EnumFields.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
--------------------------------------------------------------------------------
/src/bindings/Android/Xamarin.Azure.NotificationHubs.Android/Transforms/EnumMethods.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
--------------------------------------------------------------------------------
/src/bindings/Android/Xamarin.Azure.NotificationHubs.Android/Xamarin.Azure.NotificationHubs.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | MonoAndroid10.0
4 | true
5 | Xamarin.Azure.NotificationHubs.Android
6 | Resources
7 | Assets
8 | True
9 | Resources\Resource.designer.cs
10 | class-parse
11 | XAJavaInterop1
12 | 1.0.0.0
13 | $(SolutionDir)\.artifacts
14 |
15 | WindowsAzure.Messaging
16 | Xamarin.Azure.NotificationHubs.Android
17 |
18 |
19 |
20 | true
21 | https://github.com/Azure/azure-notificationhubs-xamarin.git
22 | git
23 | Xamarin.Azure.NotificationHubs.Android
24 | Azure Notification Hubs for Xamarin.Android
25 | Xamarin.Android Bindings for Azure Notification Hubs.
26 | https://github.com/Azure/azure-notificationhubs-xamarin/
27 | Microsoft
28 | Microsoft
29 | © Microsoft Corporation. All rights reserved.
30 | https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/main/.github/icons/aznh-icon-128x128.png
31 | aznh-icon-128x128.png
32 | MIT
33 | https://go.microsoft.com/fwlink/?linkid=864958
34 | true
35 | 1.1.6
36 |
37 |
38 |
39 |
40 | Jars\notificationhubs.aar
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src/bindings/Android/Xamarin.Azure.NotificationHubs.Android/Xamarin.Azure.NotificationHubs.Android.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Azure.NotificationHubs.Android", "Xamarin.Azure.NotificationHubs.Android.csproj", "{94785639-56A7-4292-81F9-51BD5E2A403C}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
11 | Release|iPhoneSimulator = Release|iPhoneSimulator
12 | Debug|iPhone = Debug|iPhone
13 | Release|iPhone = Release|iPhone
14 | Ad-Hoc|iPhone = Ad-Hoc|iPhone
15 | AppStore|iPhone = AppStore|iPhone
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
23 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
24 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
25 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
26 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Debug|iPhone.ActiveCfg = Debug|Any CPU
27 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Debug|iPhone.Build.0 = Debug|Any CPU
28 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Release|iPhone.ActiveCfg = Release|Any CPU
29 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Release|iPhone.Build.0 = Release|Any CPU
30 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
31 | {94785639-56A7-4292-81F9-51BD5E2A403C}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
32 | {94785639-56A7-4292-81F9-51BD5E2A403C}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
33 | {94785639-56A7-4292-81F9-51BD5E2A403C}.AppStore|iPhone.Build.0 = Debug|Any CPU
34 | EndGlobalSection
35 | GlobalSection(MonoDevelopProperties) = preSolution
36 | StartupItem = AzureMessagingSampleAndroid\AzureMessagingSampleAndroid.csproj
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/src/bindings/External-Dependency-Info.txt:
--------------------------------------------------------------------------------
1 | **Xamarin is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may require or install dependencies which are governed by additional licenses.**
2 |
3 | Note: This component depends on [Microsoft Azure Notification Hubs](https://github.com/Azure/azure-notificationhubs), which is subject to the [Microsoft Azure Notification Hubs License](https://github.com/Azure/azure-notificationhubs/blob/master/LICENSE.txt)
4 |
5 | ### Xamarin Component for Microsoft Azure Notification Hubs
6 |
7 | **The MIT License (MIT)**
8 |
9 | Copyright (c) .NET Foundation Contributors
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | 20160601
18 |
--------------------------------------------------------------------------------
/src/bindings/build.cake:
--------------------------------------------------------------------------------
1 | var TARGET = Argument ("t", Argument ("target", "ci"));
2 |
3 | var IOS_VERSION = "3.1.5";
4 | var IOS_NUGET_VERSION = "3.1.5";
5 | var IOS_URL = $"https://github.com/Azure/azure-notificationhubs-ios/releases/download/{IOS_VERSION}/WindowsAzureMessaging-SDK-Apple-{IOS_VERSION}.zip";
6 |
7 | var ANDROID_VERSION = "1.1.6";
8 | var ANDROID_NUGET_VERSION = "1.1.6";
9 | var ANDROID_URL = $"https://search.maven.org/remotecontent?filepath=com/microsoft/azure/notification-hubs-android-sdk/{ANDROID_VERSION}/notification-hubs-android-sdk-{ANDROID_VERSION}.aar";
10 |
11 | Task("libs-ios")
12 | .WithCriteria(IsRunningOnUnix())
13 | .IsDependentOn("externals-ios")
14 | .Does (() =>
15 | {
16 | MSBuild("./iOS/Xamarin.Azure.NotificationHubs.iOS/Xamarin.Azure.NotificationHubs.iOS.sln", c => {
17 | c.Configuration = "Release";
18 | c.Restore = true;
19 | c.Targets.Clear();
20 | c.Targets.Add("Rebuild");
21 | c.Properties.Add("DesignTimeBuild", new [] { "false" });
22 | c.BinaryLogger = new MSBuildBinaryLogSettings {
23 | Enabled = true,
24 | FileName = "./output/libs-ios.binlog"
25 | };
26 | });
27 | });
28 |
29 | Task("libs-android")
30 | .IsDependentOn("externals-android")
31 | .Does (() =>
32 | {
33 | MSBuild("./Android/Xamarin.Azure.NotificationHubs.Android/Xamarin.Azure.NotificationHubs.Android.sln", c => {
34 | c.Configuration = "Release";
35 | c.Restore = true;
36 | c.Targets.Clear();
37 | c.Targets.Add("Rebuild");
38 | c.Properties.Add("DesignTimeBuild", new [] { "false" });
39 | c.BinaryLogger = new MSBuildBinaryLogSettings {
40 | Enabled = true,
41 | FileName = "./output/libs-android.binlog"
42 | };
43 | });
44 | });
45 |
46 | Task("nuget-ios")
47 | .WithCriteria(IsRunningOnUnix())
48 | .IsDependentOn("libs-ios")
49 | .Does (() =>
50 | {
51 | MSBuild ("./iOS/Xamarin.Azure.NotificationHubs.iOS/Xamarin.Azure.NotificationHubs.iOS.sln", c => {
52 | c.Configuration = "Release";
53 | c.Targets.Clear();
54 | c.Targets.Add("Pack");
55 | c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath });
56 | c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
57 | c.Properties.Add("DesignTimeBuild", new [] { "false" });
58 | c.BinaryLogger = new MSBuildBinaryLogSettings {
59 | Enabled = true,
60 | FileName = "./output/nuget-ios.binlog"
61 | };
62 | });
63 | });
64 |
65 |
66 | Task("nuget-android")
67 | .IsDependentOn("libs-android")
68 | .Does (() =>
69 | {
70 | MSBuild ("./Android/Xamarin.Azure.NotificationHubs.Android/Xamarin.Azure.NotificationHubs.Android.sln", c => {
71 | c.Configuration = "Release";
72 | c.Targets.Clear();
73 | c.Targets.Add("Pack");
74 | c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath });
75 | c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
76 | c.Properties.Add("DesignTimeBuild", new [] { "false" });
77 | c.BinaryLogger = new MSBuildBinaryLogSettings {
78 | Enabled = true,
79 | FileName = "./output/nuget-android.binlog"
80 | };
81 | });
82 | });
83 |
84 |
85 | Task("samples-ios")
86 | .WithCriteria(IsRunningOnUnix())
87 | .IsDependentOn("nuget-ios")
88 | .Does (() =>
89 | {
90 | MSBuild("./iOS/samples/NotificationHubsSampleiOS.sln", c => {
91 | c.Configuration = "Release";
92 | c.Restore = true;
93 | c.Targets.Clear();
94 | c.Targets.Add("Build");
95 | c.BinaryLogger = new MSBuildBinaryLogSettings {
96 | Enabled = true,
97 | FileName = "./output/samples-ios.binlog"
98 | };
99 | });
100 | });
101 |
102 |
103 | Task("samples-android")
104 | .IsDependentOn("nuget-android")
105 | .Does (() =>
106 | {
107 | MSBuild("./Android/samples/NotificationHubsSampleAndroid.sln", c => {
108 | c.Configuration = "Release";
109 | c.Restore = true;
110 | c.Targets.Clear();
111 | c.Targets.Add("Build");
112 | c.BinaryLogger = new MSBuildBinaryLogSettings {
113 | Enabled = true,
114 | FileName = "./output/samples-android.binlog"
115 | };
116 | });
117 | });
118 |
119 | Task("ci")
120 | .IsDependentOn("nuget");
121 |
122 |
123 | Task ("externals-ios")
124 | .WithCriteria(IsRunningOnUnix())
125 | .WithCriteria (!FileExists ("./iOS/externals/sdk.zip"))
126 | .Does (() =>
127 | {
128 | EnsureDirectoryExists ("./iOS/externals");
129 |
130 | DownloadFile (IOS_URL, "./iOS/externals/sdk.zip");
131 |
132 | Unzip ("./iOS/externals/sdk.zip", "./iOS/externals");
133 |
134 | CreateDirectory("./iOS/externals/iOS");
135 | CreateDirectory("./iOS/externals/macOS");
136 | CreateDirectory("./iOS/externals/tvOS");
137 |
138 | CopyFile(
139 | "./iOS/externals/WindowsAzureMessaging-SDK-Apple/iOS/WindowsAzureMessaging.framework/WindowsAzureMessaging",
140 | "./iOS/externals/iOS/WindowsAzureMessaging.a");
141 |
142 | CopyFile(
143 | "./iOS/externals/WindowsAzureMessaging-SDK-Apple/macOS/WindowsAzureMessaging.framework/WindowsAzureMessaging",
144 | "./iOS/externals/macOS/WindowsAzureMessaging.a");
145 |
146 | CopyFile(
147 | "./iOS/externals/WindowsAzureMessaging-SDK-Apple/tvOS/WindowsAzureMessaging.framework/WindowsAzureMessaging",
148 | "./iOS/externals/tvOS/WindowsAzureMessaging.a");
149 |
150 | XmlPoke("./iOS/Xamarin.Azure.NotificationHubs.iOS/Xamarin.Azure.NotificationHubs.iOS.csproj", "/Project/PropertyGroup/PackageVersion", IOS_NUGET_VERSION);
151 | });
152 |
153 | Task ("externals-android")
154 | .WithCriteria (!FileExists ("./externals/Android/notificationhubs.aar"))
155 | .Does (() =>
156 | {
157 | EnsureDirectoryExists ("./Android/externals");
158 |
159 | Information($"Downloading from {ANDROID_URL}");
160 | DownloadFile (ANDROID_URL, "./Android/externals/notificationhubs.aar");
161 |
162 | XmlPoke("./Android/Xamarin.Azure.NotificationHubs.Android/Xamarin.Azure.NotificationHubs.Android.csproj", "/Project/PropertyGroup/PackageVersion", ANDROID_NUGET_VERSION);
163 | });
164 |
165 | Task ("externals")
166 | .IsDependentOn ("externals-ios")
167 | .IsDependentOn ("externals-android");
168 |
169 | Task ("samples")
170 | .IsDependentOn ("samples-ios")
171 | .IsDependentOn ("samples-android");
172 |
173 | Task ("nuget")
174 | .IsDependentOn ("nuget-ios")
175 | .IsDependentOn ("nuget-android");
176 |
177 | Task ("libs")
178 | .IsDependentOn ("libs-ios")
179 | .IsDependentOn ("libs-android");
180 |
181 | Task ("clean")
182 | .Does (() =>
183 | {
184 | if (DirectoryExists ("./Android/externals"))
185 | {
186 | DeleteDirectory ("./Android/externals", new DeleteDirectorySettings {
187 | Recursive = true,
188 | Force = true
189 | });
190 | }
191 |
192 | if (DirectoryExists ("./iOS/externals"))
193 | {
194 | DeleteDirectory ("./iOS/externals", new DeleteDirectorySettings {
195 | Recursive = true,
196 | Force = true
197 | });
198 | }
199 | });
200 |
201 | RunTarget (TARGET);
202 |
--------------------------------------------------------------------------------
/src/bindings/cgmanifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "Registrations":[
3 | {
4 | "component": {
5 | "type": "git",
6 | "git": {
7 | "repositoryUrl": "https://github.com/Azure/azure-notificationhubs-ios.git",
8 | "commitHash": "e4cf0b765f88448ee0d1298a34f1ef73764ee54e"
9 | },
10 | "nugetId" : "Xamarin.Azure.NotificationHubs.iOS"
11 | }
12 | },
13 | {
14 | "Component": {
15 | "Type": "Maven",
16 | "Maven": {
17 | "ArtifactId": "notification-hubs-android-sdk",
18 | "GroupId": "com.microsoft.azure",
19 | "Version": "1.0.0-preview2"
20 | },
21 | "nugetId" : "Xamarin.Azure.NotificationHubs.Android"
22 | }
23 | }
24 | ],
25 | "Version": 1
26 | }
27 |
--------------------------------------------------------------------------------
/src/bindings/iOS/Xamarin.Azure.NotificationHubs.iOS/StructsAndEnums.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WindowsAzure.Messaging
4 | {
5 | }
6 |
7 | namespace WindowsAzure.Messaging.NotificationHubs
8 | {
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/src/bindings/iOS/Xamarin.Azure.NotificationHubs.iOS/Xamarin.Azure.NotificationHubs.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20
4 | true
5 | WindowsAzure.Messaging
6 | Xamarin.Azure.NotificationHubs.iOS
7 | 1.0.0.0
8 | Resources
9 | true
10 |
11 |
12 |
13 | true
14 | https://github.com/Azure/azure-notificationhubs-xamarin.git
15 | git
16 | Xamarin.Azure.NotificationHubs.iOS
17 | Azure Notification Hubs for Xamarin.iOS, Xamarin.Mac and Xamarin.TVOS
18 | Xamarin.iOS, Xamarin.Mac and Xamarin.TVOS Bindings for Azure Notification Hubs.
19 | https://github.com/Azure/azure-notificationhubs-xamarin/
20 | Microsoft
21 | Microsoft
22 | © Microsoft Corporation. All rights reserved.
23 | https://raw.githubusercontent.com/Azure/azure-notificationhubs-xamarin/main/.github/icons/aznh-icon-128x128.png
24 | aznh-icon-128x128.png
25 | MIT
26 | https://go.microsoft.com/fwlink/?linkid=864962
27 | true
28 | 3.1.5
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | Static
50 | false
51 | Security SystemConfiguration Foundation UIKit
52 | UserNotifications
53 |
54 |
55 |
56 |
57 |
58 | Static
59 | false
60 | Security SystemConfiguration Foundation UIKit
61 | UserNotifications
62 |
63 |
64 |
65 |
66 |
67 | Static
68 | false
69 | Security SystemConfiguration Foundation AppKit
70 | UserNotifications
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/src/bindings/iOS/Xamarin.Azure.NotificationHubs.iOS/Xamarin.Azure.NotificationHubs.iOS.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29230.54
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Azure.NotificationHubs.iOS", "Xamarin.Azure.NotificationHubs.iOS.csproj", "{99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
11 | Ad-Hoc|iPhone = Ad-Hoc|iPhone
12 | Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
13 | AppStore|Any CPU = AppStore|Any CPU
14 | AppStore|iPhone = AppStore|iPhone
15 | AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
16 | Debug|Any CPU = Debug|Any CPU
17 | Debug|iPhone = Debug|iPhone
18 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
19 | Release|Any CPU = Release|Any CPU
20 | Release|iPhone = Release|iPhone
21 | Release|iPhoneSimulator = Release|iPhoneSimulator
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
25 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
26 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
27 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
28 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
29 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
30 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
31 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.AppStore|Any CPU.Build.0 = Release|Any CPU
32 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
33 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.AppStore|iPhone.Build.0 = Debug|Any CPU
34 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
35 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
36 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
39 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Debug|iPhone.Build.0 = Debug|Any CPU
40 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
41 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
42 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Release|Any CPU.Build.0 = Release|Any CPU
44 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Release|iPhone.ActiveCfg = Release|Any CPU
45 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Release|iPhone.Build.0 = Release|Any CPU
46 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
47 | {99ECFF92-CA4E-4473-ADFC-5D7F3ABBC4C6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
48 | EndGlobalSection
49 | GlobalSection(SolutionProperties) = preSolution
50 | HideSolutionNode = FALSE
51 | EndGlobalSection
52 | GlobalSection(ExtensibilityGlobals) = postSolution
53 | SolutionGuid = {3FDE3FEA-4F23-4592-88F1-12CEDB8DDEED}
54 | EndGlobalSection
55 | GlobalSection(MonoDevelopProperties) = preSolution
56 | StartupItem = AzureMessagingSampleAndroid\AzureMessagingSampleAndroid.csproj
57 | EndGlobalSection
58 | EndGlobal
59 |
--------------------------------------------------------------------------------